Wednesday 25 July 2012

set Library

<set>


A set<K> and multiset<K> are like a map and multimap, but without values. Iterators point to a K rather than a pair. There is no [] operator. set<K> m; // Elements are sorted by < on K
m.insert(k) // Add an element
m.erase(k) // Remove an element
m.find(k)!=m.end() // Test if k is in m

No comments:

Post a Comment