調子に乗って
もうちょっと楽にならないか考えてみる
template < class T >
struct CompareMixin {
public:
bool operator<( const T& x ) const
{
return static_cast<const T*>(this)->totuple() <
static_cast<const T*>(&x)->totuple();
}
};
struct Foo : public CompareMixin<Foo> {
int m0;
int m1;
boost::tuple< int, int > totuple() const
{
return boost::make_tuple( m0, m1 );
}
};ちっとも楽になってないよばーーーーーーーーーーか