Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Latest commit

 

History

History
22 lines (16 loc) · 411 Bytes

empty.md

File metadata and controls

22 lines (16 loc) · 411 Bytes

empty

Description : This method returns true if the set doesn't have any elements present in it.

Example :

//Run Code To Demonstrate use of set.empty()
#include<iostream>
#include<set>

int main(){
    // Create a set object holding integers
    std::set<int> mySet {1,2,3,4,-5};

    std::cout << mySet.empty() <<std::endl;
    return 0;
}

Run Code