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 Èæ³Ó¤·¤Þ¤¹¡£
21 Èæ³ÓŪ¿¤¤Áàºî¤Ê¤Î¤Ç¡¢Ã»¤¯»È¤¨¤ë¤è¤¦¤Ë¡£
25 #include "enable_if.hpp"
27 #include <boost/type_traits/remove_cv.hpp>
28 #include <boost/type_traits/is_same.hpp>
32 // CV ½¤¾þ¤ò½ü¤¤¤ÆƱ¤¸¥¯¥é¥¹¤«Èݤ«
33 template<typename T1, typename T2>
35 : boost::is_same< typename boost::remove_cv<T1>::type,
36 typename boost::remove_cv<T2>::type > {};
38 // CV ½¤¾þ¤ò½ü¤¤¤ÆƱ¤¸¤Ê¤é͸ú¤Ë¤Ê¤ë
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_