1 #ifndef GINTENLIB_INCLUDED_IS_SAME_CLASS_HPP_
2 #define GINTENLIB_INCLUDED_IS_SAME_CLASS_HPP_
5 <gintenlib/is_same_class.hpp>
7 is_same_class : const, volatile を除いた状態での型の比較
10 template< typename T1, typename T2 >
13 static bool const value;
15 template< typename T1, typename T2, typename T = void >
16 class enable_if_same_class
17 : enable_if< is_same_class<T1, T2>, T > {};
20 下の定義を見れば一目瞭然。remove_cv して is_same 比較します。
25 #include "enable_if.hpp"
27 #include <boost/type_traits/remove_cv.hpp>
28 #include <boost/type_traits/is_same.hpp>
33 template<typename T1, typename T2>
35 : boost::is_same< typename boost::remove_cv<T1>::type,
36 typename boost::remove_cv<T2>::type > {};
39 template<typename T1, typename T2, typename T = void>
40 struct enable_if_same_class
41 : enable_if< is_same_class<T1, T2>, T > {};
43 } // namespace gintenlib
45 #endif // #ifndef GINTENLIB_INCLUDED_IS_SAME_CLASS_HPP_