Are there any language lawyers in the house?
Should the following code compile?
include <set>
bool fn( const std::set<int>& rSet )
{
if ( rSet.find( 42 ) != rSet.end() ) return true;
return false;
}
On one of the platforms (Sun Workshop) this does not compile. It reports that the find function returned an iterator and the end function that returned a const_iterator and that it does not have a valid comparison operator between those types.
The following does compile:
include <set>
bool fn( std::set<int>& rSet )
{
if ( rSet.find( 42 ) != rSet.end() ) return true;
return false;
}