has_type.cpp 720 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright Abel Sinkovics (abel@sinkovics.hu) 2014.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #include <boost/metaparse/v1/impl/has_type.hpp>
  6. #include <boost/mpl/assert.hpp>
  7. #include <boost/mpl/not.hpp>
  8. #include "test_case.hpp"
  9. namespace
  10. {
  11. struct nullary_metafunction
  12. {
  13. typedef int type;
  14. };
  15. }
  16. BOOST_METAPARSE_TEST_CASE(has_type)
  17. {
  18. using boost::metaparse::v1::impl::has_type;
  19. using boost::mpl::not_;
  20. // test_int_has_no_type
  21. BOOST_MPL_ASSERT((not_<has_type<int>::type>));
  22. // test_nullary_metafunction_has_type
  23. BOOST_MPL_ASSERT((has_type<nullary_metafunction>));
  24. }