#include <iostream>#include <set>usingnamespacestd;
bool fncomp (int lhs, int rhs) {return lhs<rhs;}
struct classcomp {
booloperator() (constint& lhs, constint& rhs) const
{return lhs<rhs;}
};
int main ()
{
set<int> first; // empty set of intsint myints[]= {10,20,30,40,50};
set<int> second (myints,myints+5); // pointers used as iteratorsset<int> third (second); // a copy of secondset<int> fourth (second.begin(), second.end()); // iterator ctor.set<int,classcomp> fifth; // class as Comparebool(*fn_pt)(int,int) = fncomp;
set<int,bool(*)(int,int)> sixth (fn_pt); // function pointer as Comparereturn0;
}