mp_inherit.cpp 654 B

123456789101112131415161718192021222324252627
  1. // Copyright 2015 Peter Dimov.
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. //
  5. // See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt
  7. #include <boost/core/lightweight_test_trait.hpp>
  8. #include <boost/mp11/utility.hpp>
  9. #include <type_traits>
  10. struct X1 {};
  11. struct X2 {};
  12. struct X3 {};
  13. int main()
  14. {
  15. using boost::mp11::mp_inherit;
  16. BOOST_TEST_TRAIT_TRUE((std::is_base_of<X1, mp_inherit<X1, X2, X3>>));
  17. BOOST_TEST_TRAIT_TRUE((std::is_base_of<X2, mp_inherit<X1, X2, X3>>));
  18. BOOST_TEST_TRAIT_TRUE((std::is_base_of<X3, mp_inherit<X1, X2, X3>>));
  19. return boost::report_errors();
  20. }