タグ

c++とSFINAEに関するcrafのブックマーク (1)

  • それ、C++0xでできるよ!

    コンセプトなしでテンプラ引数が、特定のメンバ関数を持ってるか調べられるの? SFINAEでできるよ! // Overload Resolutionと併用する場合。 class has_xxx { typedef char yes_type ; typedef struct { char c[8]; } no_type ; // Unified Function Syntaxが入れば、autoではなく[]になる。 template< typename U > static auto check( void ) -> decltype( std::value<U>.xxx(), yes_type); template< typename U > static no_type check( void ) ; public: static bool const value = std::is_sa

  • 1