I am trying to use set.insert (key) as a conditional, where if the key is inserted correctly (meaning that the key does NOT already exsist in the set ) then it should go on and perform some kind of code. For example, something like:
if (set.insert( key ) {
// some kind of code
}
Is this allowed? Because the compiler is throwing this back at me:
conditional expression of type 'std::_Tree<_Traits>::iterator' is illegal
Thanks in advance,
Tomek