【注意】STLの落とし穴【危険】
■ このスレッドは過去ログ倉庫に格納されています
0697デフォルトの名無しさん
2010/10/11(月) 02:56:42もう大抵の処理系で使えるんじゃないの?
template<> struct std::less<void(Class::*)(int)> : public std::binary_function <void(Class::*)(int), void(Class::*)(int), bool> {
bool operator()( void(Class::*_Left)(int) , void(Class::*_Right)(int) ) const
{ return *reinterpret_cast<intptr_t*>(&_Left) < *reinterpret_cast<intptr_t*>(&_Right); }
};
不定といったって、実行時に変化するわけじゃないでしょ。
大小関係が実行時に一定なら、この用途には充分。
一定じゃない実装も考えうるけど。
■ このスレッドは過去ログ倉庫に格納されています