【C++】template 統合スレ -- STL/Boost/Loki, etc.
■ このスレッドは過去ログ倉庫に格納されています
0491デフォルトの名無しさん
NGNGなんでこんなヘンなことやってるの?
operator bool()ではいけないんですか?
// implicit conversion to "bool"
typedef T * (this_type::*unspecified_bool_type)() const;
operator unspecified_bool_type() const // never throws
{
return ptr == 0? 0: &this_type::get;
}
■ このスレッドは過去ログ倉庫に格納されています