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".
const ContentEntity* const& _Leftconst ContentEntity*&is a non-const reference to pointer toconst ContentEntity.const const T*&is notconst (const T*)&, it is(const const T)*&; theconstis duplicated so one of them is ignored.const int&is a reference to a const int. Butint& constwould be an attempt at a const reference to a (non-const) int.