std::set
requires that the comparator maintain a strict weak ordering of its elements. Your comparator doesn't because it fails the irreflexivity and asymmetry requirements, and possibly others too. Changing your comparator to the following will fix the error but it may not preserve the semantics you want.
class Compare
{
public:
bool operator()(Information const& lf, Information const& rt) const
{
return( lf.comp_num() < rt.comp_num() );
}
};
Note that changing the arguments to Information const&
is not required, but it avoids unnecessary copying.