copy_reference_test.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. Copyright 2019 Glen Joseph Fernandes
  3. (glenjofe@gmail.com)
  4. Distributed under the Boost Software License,
  5. Version 1.0. (See accompanying file LICENSE_1_0.txt
  6. or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. */
  8. #ifdef TEST_STD
  9. #include <type_traits>
  10. #else
  11. #include <boost/type_traits/copy_reference.hpp>
  12. #endif
  13. #include "test.hpp"
  14. #include "check_type.hpp"
  15. TT_TEST_BEGIN(copy_reference)
  16. BOOST_CHECK_TYPE3(::tt::copy_reference<int, char>::type, int);
  17. BOOST_CHECK_TYPE3(::tt::copy_reference<int, char&>::type, int&);
  18. BOOST_CHECK_TYPE3(::tt::copy_reference<int&, char>::type, int&);
  19. BOOST_CHECK_TYPE3(::tt::copy_reference<int&, char&>::type, int&);
  20. #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
  21. BOOST_CHECK_TYPE3(::tt::copy_reference<int, char&&>::type, int&&);
  22. BOOST_CHECK_TYPE3(::tt::copy_reference<int&, char&&>::type, int&);
  23. BOOST_CHECK_TYPE3(::tt::copy_reference<int&&, char>::type, int&&);
  24. BOOST_CHECK_TYPE3(::tt::copy_reference<int&&, char&>::type, int&);
  25. BOOST_CHECK_TYPE3(::tt::copy_reference<int&&, char&&>::type, int&&);
  26. #endif
  27. TT_TEST_END