is_bounded_array_test.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. Copyright 2018 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/is_bounded_array.hpp>
  12. #endif
  13. #include "check_integral_constant.hpp"
  14. TT_TEST_BEGIN(is_bounded_array)
  15. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<void>::value, false);
  16. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<int>::value, false);
  17. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<int*>::value, false);
  18. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<int&>::value, false);
  19. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<int[2]>::value, true);
  20. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<const int[3]>::value, true);
  21. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<const volatile int[4]>::value, true);
  22. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<int[5][6]>::value, true);
  23. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<int[]>::value, false);
  24. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<const int[]>::value, false);
  25. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<const volatile int[]>::value, false);
  26. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<int[][7]>::value, false);
  27. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<int(&)[8]>::value, false);
  28. #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
  29. BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_bounded_array<int(&&)[9]>::value, false);
  30. #endif
  31. TT_TEST_END