mp_second.cpp 878 B

12345678910111213141516171819202122232425262728293031323334
  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/list.hpp>
  9. #include <type_traits>
  10. #include <tuple>
  11. #include <utility>
  12. int main()
  13. {
  14. using boost::mp11::mp_list;
  15. using boost::mp11::mp_second;
  16. using L1 = mp_list<void, char[]>;
  17. BOOST_TEST_TRAIT_TRUE((std::is_same<mp_second<L1>, char[]>));
  18. using L2 = mp_list<int[], void, float>;
  19. BOOST_TEST_TRAIT_TRUE((std::is_same<mp_second<L2>, void>));
  20. using L3 = std::tuple<int, float>;
  21. BOOST_TEST_TRAIT_TRUE((std::is_same<mp_second<L3>, float>));
  22. using L4 = std::pair<char, double>;
  23. BOOST_TEST_TRAIT_TRUE((std::is_same<mp_second<L4>, double>));
  24. return boost::report_errors();
  25. }