2007-11-20から1日間の記事一覧

operator , >=

C++

忘れがちなのでメモ, >=演算子の定義方法 struct widget { int id; }; bool operator<(const widget& lhs, const widget& rhs) { return lhs.id < rhs.id; } bool operator>(const widget& lhs, const widget& rhs) { return rhs < lhs; } bool operator<=(c…