hi,
CString buff( "abc" );
std::set< CString > s;
s.insert( buff );
s.insert( buff );
s.insert( buff );
s.insert( buff );
s.insert( buff );
s.insert( buff );
does the set inserts "abc" once ?
thanks
Printable View
hi,
CString buff( "abc" );
std::set< CString > s;
s.insert( buff );
s.insert( buff );
s.insert( buff );
s.insert( buff );
s.insert( buff );
s.insert( buff );
does the set inserts "abc" once ?
thanks
Yes. Just examine s.size()
If you want it inserted more than once, use multiset instead of set
thanks Philip.
let me extend the question, when i insert n items to the set,
and than iterate on the set, do i get the items at the same
order they were inserted ?
No. set orders the items. By default, it uses operator <
but you can provide the constructor with a predicate also.
thanks again :)