test_nothrow_gmp.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  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/gmp.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::mpz_int>::value);
  18. BOOST_STATIC_ASSERT(boost::is_nothrow_move_constructible<boost::multiprecision::mpq_rational>::value);
  19. BOOST_STATIC_ASSERT(boost::is_nothrow_move_constructible<boost::multiprecision::mpf_float>::value);
  20. #endif
  21. #if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_IS_NOTHROW_MOVE_ASSIGN)
  22. //
  23. // Move assign:
  24. //
  25. BOOST_STATIC_ASSERT(boost::is_nothrow_move_assignable<boost::multiprecision::mpz_int>::value);
  26. BOOST_STATIC_ASSERT(boost::is_nothrow_move_assignable<boost::multiprecision::mpq_rational>::value);
  27. BOOST_STATIC_ASSERT(boost::is_nothrow_move_assignable<boost::multiprecision::mpf_float>::value);
  28. #endif
  29. #endif // noexcept