1 // Copyright (C) 2005 Arkadiy Vertleyb 2 // Use, modification and distribution is subject to the Boost Software 3 // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) 4 5 #ifndef BOOST_TYPEOF_TEST_HPP_INCLUDED 6 #define BOOST_TYPEOF_TEST_HPP_INCLUDED 7 8 #include <boost/typeof/typeof.hpp> 9 #include <boost/type_traits/is_same.hpp> 10 #include <boost/static_assert.hpp> 11 12 namespace boost { namespace type_of { 13 14 template<class T, class U> 15 struct test_wrapper{}; 16 17 template<class T> 18 T test_make(T*); 19 20 template<class T> 21 struct test 22 { 23 BOOST_STATIC_CONSTANT(std::size_t,value = (boost::is_same< 24 BOOST_TYPEOF_TPL(test_make((test_wrapper<T, int>*)0)), 25 test_wrapper<T, int> 26 >::value) 27 ); 28 }; 29 30 }} 31 32 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() 33 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::type_of::test_wrapper, 2) 34 35 #endif//BOOST_TYPEOF_TEST_HPP_INCLUDED 36