c++

STLのless

c++

ひさびさにSTL書いたら、コンパイルエラーでげんなりしたのでメモ。 struct A { bool operator<(const A &other) const; もしくは friend bool operator<(const A &lhs, const B &rhs); }; constメンバ関数にし忘れることが多い。