The STL Set Class

By Jason Shankel

Dr. Dobb's Journal December 1997

set<int,less<int> > ::iterator
find_it;
//Object in set
find_it=myIntSet.find(5);
//(*find_it)==5
//Object not in set
find_it=myIntSet.find(20);
//find_it==myIntSet.end()

Example 2: If a set does not contain the object, find returns the end iterator.

Back to Sidebar


Copyright © 1997, Dr. Dobb's Journal