is_object_test.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // (C) Copyright John Maddock 2000.
  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.boost.org/LICENSE_1_0.txt)
  5. #ifdef TEST_STD
  6. # include <type_traits>
  7. #else
  8. # include <boost/type_traits/is_object.hpp>
  9. #endif
  10. #include "test.hpp"
  11. #include "check_integral_constant.hpp"
  12. TT_TEST_BEGIN(is_object)
  13. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<int>::value, true);
  14. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<UDT>::value, true);
  15. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<int&>::value, false);
  16. #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
  17. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<int&&>::value, false);
  18. #endif
  19. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<void>::value, false);
  20. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<foo4_t>::value, false);
  21. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<test_abc1>::value, true);
  22. // this one is only partly correct:
  23. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<incomplete_type>::value, true);
  24. TT_TEST_END