test_checked_cast.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. #ifndef BOOST_SAFE_NUMERICS_TEST_CHECKED_CAST_HPP
  2. #define BOOST_SAFE_NUMERICS_TEST_CHECKED_CAST_HPP
  3. // Copyright (c) 2018 Robert Ramey
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See
  6. // accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. #include <boost/mp11/integral.hpp>
  9. #include "test_values.hpp"
  10. // note: the types indexed on the left side of the table are gathered
  11. // by filtering the test_values list. So the types are in the same
  12. // sequence
  13. constexpr const char *test_result_cast[boost::mp11::mp_size<test_values>::value] = {
  14. // 0 0 0 0
  15. // 01234567012345670123456701234567
  16. // 01234567890123456789012345678901
  17. /* 0*/ ".....xx..xx..xx...xx.xxx.xxx.xxx",
  18. /* 1*/ ".........xx..xx.......xx.xxx.xxx",
  19. /* 2*/ ".............xx...........xx.xxx",
  20. /* 3*/ "..............................xx",
  21. /* 4*/ "..xx.xxx.xxx.xxx.....xxx.xxx.xxx",
  22. /* 5*/ "..xx..xx.xxx.xxx.........xxx.xxx",
  23. /* 6*/ "..xx..xx..xx.xxx.............xxx",
  24. /* 7*/ "..xx..xx..xx..xx................"
  25. };
  26. #endif // BOOST_SAFE_NUMERICS_TEST_CHECKED_CAST_HPP