I want to create the following class, but the compiler gives an error (it tells that the signatures of the methods are the same):
struct entities_set_less
{
constexpr bool operator()(const ContentEntity*& _Left, const ContentEntity*& _Right) const
{ // apply operator< to operands
return (_Left < _Right);
}
constexpr bool operator()( const const ContentEntity*& _Left, const const ContentEntity*&_Right) const
{ // apply operator< to operands
return (_Left < _Right);
}
};
From my point of view, an expression like const const ContentEntity*& means "const reference to pointer on const ContentEntity". It should be different from const ContentEntity*&, which is just "const reference to pointer on non const type".