get_tag_def.cpp 747 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright Sergey Krivonos 2017
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/mpl for documentation.
  8. // $Id$
  9. // $Date$
  10. // $Revision$
  11. #include <boost/mpl/get_tag.hpp>
  12. #include <boost/mpl/aux_/test.hpp>
  13. #include <boost/mpl/aux_/test/assert.hpp>
  14. #include <boost/type_traits/is_same.hpp>
  15. struct test_type_get_tag_def
  16. {
  17. typedef int a_tag;
  18. };
  19. BOOST_MPL_GET_TAG_DEF(a_tag);
  20. MPL_TEST_CASE()
  21. {
  22. MPL_ASSERT(( is_same<int, boost::mpl::get_a_tag<test_type_get_tag_def>::type> ));
  23. MPL_ASSERT(( is_same<test_type_get_tag_def::a_tag, boost::mpl::get_a_tag<test_type_get_tag_def>::type> ));
  24. }