Код: Выделить всё
class Module {
public:
static std::shared_ptr create();
explicit Module() = default;
...
protected:
...
/// Map that caches Foo object keyed on @c Identifier.
std::map m_FooMap;
};
Код: Выделить всё
Foo foo; m_FooMap.emplace(identifier, foo);Код: Выделить всё
/local/home/workspace/build/usr/include/c++/v1/__functional/operations.h:372:21: error: invalid operands to binary expression ('const Identifier' and 'const Identifier')
{return __x < __y;}
~~~ ^ ~~~
/local/home/workspace/build/usr/include/c++/v1/map:598:17: note: in an instantiation of member function 'std::less::operator()' requested here
{return static_cast(*this)(__x, __y.__get_value().first);}
^
/local/home/workspace/build/usr/include/c++/v1/__tree:1974:17: note: in instantiation of member function 'std::__map_value_compare, std::less, true>::operator()' requested here
if (value_comp()(__v, __nd->__value_))
^
Код: Выделить всё
// Overloading the less-than operator for the Identifier
// objects
bool operator
Подробнее здесь: [url]https://stackoverflow.com/questions/79286801/clarification-regarding-operator-overloading[/url]
Мобильная версия