test.hpp 921 B

1234567891011121314151617181920212223242526272829303132333435
  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. #ifndef BOOST_TYPEOF_TEST_HPP_INCLUDED
  5. #define BOOST_TYPEOF_TEST_HPP_INCLUDED
  6. #include <boost/typeof/typeof.hpp>
  7. #include <boost/type_traits/is_same.hpp>
  8. #include <boost/static_assert.hpp>
  9. namespace boost { namespace type_of {
  10. template<class T, class U>
  11. struct test_wrapper{};
  12. template<class T>
  13. T test_make(T*);
  14. template<class T>
  15. struct test
  16. {
  17. BOOST_STATIC_CONSTANT(std::size_t,value = (boost::is_same<
  18. BOOST_TYPEOF_TPL(test_make((test_wrapper<T, int>*)0)),
  19. test_wrapper<T, int>
  20. >::value)
  21. );
  22. };
  23. }}
  24. #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
  25. BOOST_TYPEOF_REGISTER_TEMPLATE(boost::type_of::test_wrapper, 2)
  26. #endif//BOOST_TYPEOF_TEST_HPP_INCLUDED