创建set
// constructing sets
#include <iostream>
#include <set>
bool fncomp (int lhs, int rhs) {
return lhs<rhs;}
struct classcomp {
bool operator() (const int& lhs, const int& rhs) const
{
return lhs<rhs;}
};
int main ()
{
std::set<int> first; // empty set of ints
int myints[]= {
10,20,30,40,50};
std::set<int> second (myints,myints+5); // range
std::set<int> third (second); // a copy of second
std::set<int> fourth (second.begin(), second.end())