]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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 | ||
6 | #include <boost/multiprecision/float128.hpp> | |
1e59de90 | 7 | #include <type_traits> |
7c673cae | 8 | |
7c673cae FG |
9 | // |
10 | // Move construct: | |
11 | // | |
1e59de90 | 12 | static_assert(std::is_nothrow_move_constructible<boost::multiprecision::float128>::value, "noexcept test"); |
7c673cae FG |
13 | // |
14 | // Move assign: | |
15 | // | |
1e59de90 | 16 | static_assert(std::is_nothrow_move_assignable<boost::multiprecision::float128>::value, "noexcept test"); |
7c673cae FG |
17 | // |
18 | // Construct: | |
19 | // | |
1e59de90 | 20 | static_assert(std::is_nothrow_default_constructible<boost::multiprecision::float128>::value, "noexcept test"); |
7c673cae FG |
21 | // |
22 | // Copy construct: | |
23 | // | |
1e59de90 | 24 | static_assert(std::is_nothrow_copy_constructible<boost::multiprecision::float128>::value, "noexcept test"); |
7c673cae FG |
25 | // |
26 | // Assign: | |
27 | // | |
1e59de90 TL |
28 | static_assert(std::is_nothrow_copy_assignable<boost::multiprecision::float128>::value, "noexcept test"); |
29 | ||
30 | static_assert(noexcept(boost::multiprecision::float128()), "noexcept test"); | |
31 | static_assert(noexcept(boost::multiprecision::float128(std::declval<const boost::multiprecision::float128&>())), "noexcept test"); | |
32 | static_assert(noexcept(boost::multiprecision::float128(std::declval<boost::multiprecision::float128>())), "noexcept test"); | |
33 | static_assert(noexcept(boost::multiprecision::float128(std::declval<const float128_type&>())), "noexcept test"); | |
34 | static_assert(noexcept(boost::multiprecision::float128(std::declval<float128_type>())), "noexcept test"); | |
35 | static_assert(noexcept(boost::multiprecision::float128(std::declval<const double&>())), "noexcept test"); | |
36 | static_assert(noexcept(boost::multiprecision::float128(std::declval<double>())), "noexcept test"); | |
37 | static_assert(noexcept(std::declval<boost::multiprecision::float128&>() = std::declval<const boost::multiprecision::float128&>()), "noexcept test"); | |
38 | static_assert(noexcept(std::declval<boost::multiprecision::float128&>() = std::declval<boost::multiprecision::float128>()), "noexcept test"); | |
39 | static_assert(noexcept(std::declval<boost::multiprecision::float128&>() = std::declval<const float128_type&>()), "noexcept test"); | |
40 | static_assert(noexcept(std::declval<boost::multiprecision::float128&>() = std::declval<float128_type>()), "noexcept test"); | |
41 | static_assert(noexcept(std::declval<boost::multiprecision::float128&>() = std::declval<const double&>()), "noexcept test"); | |
42 | static_assert(noexcept(std::declval<boost::multiprecision::float128&>() = std::declval<double>()), "noexcept test"); | |
7c673cae FG |
43 | |
44 | struct any_convert | |
45 | { | |
46 | template <class T> | |
92f5a8d4 | 47 | operator T() const; // Can throw! |
7c673cae FG |
48 | }; |
49 | ||
1e59de90 TL |
50 | static_assert(!noexcept(boost::multiprecision::float128(std::declval<const any_convert&>())), "noexcept test"); |
51 | static_assert(!noexcept(boost::multiprecision::float128(std::declval<any_convert>())), "noexcept test"); | |
52 | static_assert(!noexcept(std::declval<boost::multiprecision::float128&>() = std::declval<const any_convert&>()), "noexcept test"); | |
53 | static_assert(!noexcept(std::declval<boost::multiprecision::float128&>() = std::declval<any_convert>()), "noexcept test"); | |
7c673cae | 54 |