test_nothrow_cpp_bin_float.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Copyright 2015 John Maddock. Distributed under the Boost
  3. // 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. #include <boost/multiprecision/cpp_bin_float.hpp>
  6. #include <boost/type_traits/is_nothrow_move_constructible.hpp>
  7. #include <boost/type_traits/is_nothrow_move_assignable.hpp>
  8. #include <boost/type_traits/has_nothrow_constructor.hpp>
  9. #include <boost/type_traits/has_nothrow_assign.hpp>
  10. #include <boost/type_traits/has_nothrow_copy.hpp>
  11. #include <boost/static_assert.hpp>
  12. #ifndef BOOST_NO_CXX11_NOEXCEPT
  13. #if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_IS_NOTHROW_MOVE_CONSTRUCT)
  14. //
  15. // Move construct:
  16. //
  17. BOOST_STATIC_ASSERT(boost::is_nothrow_move_constructible<boost::multiprecision::cpp_bin_float_100>::value);
  18. #endif
  19. #if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_IS_NOTHROW_MOVE_ASSIGN)
  20. //
  21. // Move assign:
  22. //
  23. BOOST_STATIC_ASSERT(boost::is_nothrow_move_assignable<boost::multiprecision::cpp_bin_float_100>::value);
  24. #endif
  25. //
  26. // Construct:
  27. //
  28. #ifdef BOOST_HAS_NOTHROW_CONSTRUCTOR
  29. BOOST_STATIC_ASSERT(boost::has_nothrow_constructor<boost::multiprecision::cpp_bin_float_100>::value);
  30. #endif
  31. //
  32. // Copy construct:
  33. //
  34. #ifdef BOOST_HAS_NOTHROW_COPY
  35. BOOST_STATIC_ASSERT(boost::has_nothrow_copy<boost::multiprecision::cpp_bin_float_100>::value);
  36. #endif
  37. //
  38. // Assign:
  39. //
  40. #ifdef BOOST_HAS_NOTHROW_ASSIGN
  41. BOOST_STATIC_ASSERT(boost::has_nothrow_assign<boost::multiprecision::cpp_bin_float_100>::value);
  42. #endif
  43. #endif // noexcept