copy_cv_test.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright Peter Dimov 2015
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt)
  5. #ifdef TEST_STD
  6. # include <type_traits>
  7. #else
  8. # include <boost/type_traits/copy_cv.hpp>
  9. #endif
  10. #include "test.hpp"
  11. #include "check_type.hpp"
  12. #include <iostream>
  13. TT_TEST_BEGIN(copy_cv)
  14. {
  15. BOOST_CHECK_TYPE3(tt::copy_cv<int, void>::type, int);
  16. BOOST_CHECK_TYPE3(tt::copy_cv<int const, void>::type, int const);
  17. BOOST_CHECK_TYPE3(tt::copy_cv<int volatile, void>::type, int volatile);
  18. BOOST_CHECK_TYPE3(tt::copy_cv<int const volatile, void>::type, int const volatile);
  19. BOOST_CHECK_TYPE3(tt::copy_cv<int, void const>::type, int const);
  20. BOOST_CHECK_TYPE3(tt::copy_cv<int const, void const>::type, int const);
  21. BOOST_CHECK_TYPE3(tt::copy_cv<int volatile, void const>::type, int const volatile);
  22. BOOST_CHECK_TYPE3(tt::copy_cv<int const volatile, void const>::type, int const volatile);
  23. BOOST_CHECK_TYPE3(tt::copy_cv<int, void volatile>::type, int volatile);
  24. BOOST_CHECK_TYPE3(tt::copy_cv<int const, void volatile>::type, int const volatile);
  25. BOOST_CHECK_TYPE3(tt::copy_cv<int volatile, void volatile>::type, int volatile);
  26. BOOST_CHECK_TYPE3(tt::copy_cv<int const volatile, void volatile>::type, int const volatile);
  27. BOOST_CHECK_TYPE3(tt::copy_cv<int, void const volatile>::type, int const volatile);
  28. BOOST_CHECK_TYPE3(tt::copy_cv<int const, void const volatile>::type, int const volatile);
  29. BOOST_CHECK_TYPE3(tt::copy_cv<int volatile, void const volatile>::type, int const volatile);
  30. BOOST_CHECK_TYPE3(tt::copy_cv<int const volatile, void const volatile>::type, int const volatile);
  31. BOOST_CHECK_TYPE3(tt::copy_cv<int&, void const volatile>::type, int&);
  32. BOOST_CHECK_TYPE3(tt::copy_cv<int const*, void volatile>::type, int const* volatile);
  33. BOOST_CHECK_TYPE3(tt::copy_cv<long, int const volatile&>::type, long);
  34. }
  35. TT_TEST_END