From 979af136a1a0a64394b8d5c80876d45c26498c7d Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Thu, 14 Aug 2014 22:55:49 +0900 Subject: [PATCH] fix macros for noexcept --- sprout/array/array.hpp | 4 +-- sprout/compressed_pair.hpp | 10 +++---- sprout/config/suffix.hpp | 15 ++++++++-- sprout/container/container_holder.hpp | 4 +-- sprout/ctype/functor.hpp | 4 +-- sprout/darkroom/access/access.hpp | 2 +- sprout/darkroom/colors/rgb.hpp | 10 +++---- sprout/darkroom/coords/vector.hpp | 6 ++-- sprout/darkroom/intersects/intersection.hpp | 14 +++++----- sprout/darkroom/materials/material.hpp | 16 +++++------ sprout/darkroom/rays/ray.hpp | 4 +-- sprout/detail/integer/integer_mask.hpp | 6 ++-- sprout/detail/predef.hpp | 28 +++++++++---------- sprout/forward_clist.hpp | 9 ++++-- sprout/functional/address_of.hpp | 2 +- sprout/functional/assign.hpp | 2 +- sprout/functional/bit_and.hpp | 2 +- sprout/functional/bit_and_assign.hpp | 2 +- sprout/functional/bit_not.hpp | 2 +- sprout/functional/bit_or.hpp | 2 +- sprout/functional/bit_or_assign.hpp | 2 +- sprout/functional/bit_xor.hpp | 2 +- sprout/functional/bit_xor_assign.hpp | 2 +- sprout/functional/call_fun.hpp | 2 +- sprout/functional/comma.hpp | 2 +- sprout/functional/cond.hpp | 2 +- sprout/functional/dereference.hpp | 2 +- sprout/functional/divides.hpp | 2 +- sprout/functional/divides_assign.hpp | 2 +- sprout/functional/equal_to.hpp | 2 +- sprout/functional/greater.hpp | 2 +- sprout/functional/greater_equal.hpp | 2 +- sprout/functional/hash/hash.hpp | 18 ++++++------ sprout/functional/less.hpp | 2 +- sprout/functional/less_equal.hpp | 2 +- sprout/functional/logical_and.hpp | 2 +- sprout/functional/logical_not.hpp | 2 +- sprout/functional/logical_or.hpp | 2 +- sprout/functional/mem_ptr.hpp | 2 +- sprout/functional/member.hpp | 2 +- sprout/functional/minus.hpp | 2 +- sprout/functional/minus_assign.hpp | 2 +- sprout/functional/modulus.hpp | 2 +- sprout/functional/modulus_assign.hpp | 2 +- sprout/functional/multiplies.hpp | 2 +- sprout/functional/multiplies_assign.hpp | 2 +- sprout/functional/negate.hpp | 2 +- sprout/functional/not_equal_to.hpp | 2 +- sprout/functional/plus.hpp | 2 +- sprout/functional/plus_assign.hpp | 2 +- sprout/functional/polymorphic/bind1st.hpp | 2 +- sprout/functional/polymorphic/bind2nd.hpp | 2 +- sprout/functional/posite.hpp | 2 +- sprout/functional/post_dec.hpp | 2 +- sprout/functional/post_inc.hpp | 2 +- sprout/functional/pre_dec.hpp | 2 +- sprout/functional/pre_inc.hpp | 2 +- sprout/functional/shift_left.hpp | 2 +- sprout/functional/shift_left_assign.hpp | 2 +- sprout/functional/shift_right.hpp | 2 +- sprout/functional/shift_right_assign.hpp | 2 +- sprout/functional/subscript.hpp | 2 +- sprout/generator/generated_value.hpp | 14 +++++----- sprout/generator/generator_access_traits.hpp | 28 +++++++++---------- sprout/generator/next_generator.hpp | 14 +++++----- sprout/iterator/adjacent_filter_iterator.hpp | 4 +-- sprout/iterator/alternate_iterator.hpp | 4 +-- sprout/iterator/back_insert_iterator.hpp | 4 +-- sprout/iterator/bytes_iterator.hpp | 4 +-- sprout/iterator/clamp_iterator.hpp | 4 +-- sprout/iterator/counting_iterator.hpp | 4 +-- sprout/iterator/dft_iterator.hpp | 7 +++-- sprout/iterator/filter_iterator.hpp | 4 +-- sprout/iterator/front_insert_iterator.hpp | 4 +-- sprout/iterator/generator_iterator.hpp | 4 +-- sprout/iterator/idft_iterator.hpp | 7 +++-- sprout/iterator/index_iterator.hpp | 4 +-- sprout/iterator/indexed_iterator.hpp | 4 +-- sprout/iterator/insert_iterator.hpp | 4 +-- sprout/iterator/insert_range_iterator.hpp | 4 +-- sprout/iterator/joint_iterator.hpp | 4 +-- sprout/iterator/merge_iterator.hpp | 4 +-- sprout/iterator/move_iterator.hpp | 4 +-- sprout/iterator/next_iterator.hpp | 7 +++-- sprout/iterator/ptr_index_iterator.hpp | 2 +- sprout/iterator/remake_iterator.hpp | 4 +-- sprout/iterator/reverse_iterator.hpp | 4 +-- sprout/iterator/sawtooth_iterator.hpp | 2 +- sprout/iterator/set_difference_iterator.hpp | 4 +-- sprout/iterator/set_intersection_iterator.hpp | 4 +-- .../set_symmetric_difference_iterator.hpp | 4 +-- sprout/iterator/set_union_iterator.hpp | 4 +-- sprout/iterator/sinusoid_iterator.hpp | 2 +- sprout/iterator/size_enum_iterator.hpp | 6 ++-- sprout/iterator/square_iterator.hpp | 2 +- sprout/iterator/step_iterator.hpp | 4 +-- sprout/iterator/transform_iterator.hpp | 6 ++-- sprout/iterator/triangle_iterator.hpp | 2 +- sprout/iterator/value_iterator.hpp | 4 +-- sprout/iterator/valued_iterator.hpp | 4 +-- sprout/iterator/while_iterator.hpp | 4 +-- sprout/optional/optional.hpp | 10 +++---- sprout/pit/pit.hpp | 4 +-- sprout/pit/tuple.hpp | 2 +- sprout/random/random_result.hpp | 6 ++-- sprout/random/results.hpp | 4 +-- sprout/random/variate_generator.hpp | 4 +-- sprout/range/range_container.hpp | 2 +- sprout/static_warning.hpp | 20 ++++++------- sprout/string/string.hpp | 4 +-- sprout/string/to_string_value.hpp | 2 +- sprout/sub_array/sub_array.hpp | 4 +-- sprout/sub_array/tuple.hpp | 6 ++-- sprout/tuple/tuple/get.hpp | 10 +++---- sprout/tuple/tuple/tuple_decl.hpp | 24 ++++++++++++---- sprout/utility/pair/first.hpp | 2 +- sprout/utility/pair/pair_decl.hpp | 16 +++++++---- sprout/utility/pair/second.hpp | 2 +- sprout/utility/string_ref/string_ref.hpp | 2 +- sprout/utility/swap.hpp | 6 ++-- sprout/utility/value_holder/value_holder.hpp | 4 +-- sprout/uuid/uuid.hpp | 2 +- sprout/variant/variant.hpp | 8 +++--- .../recursive_function_template.hpp | 16 +++++------ testspr/iterator.hpp | 4 +-- 125 files changed, 324 insertions(+), 287 deletions(-) diff --git a/sprout/array/array.hpp b/sprout/array/array.hpp index 8ae6305b..b5475bcc 100644 --- a/sprout/array/array.hpp +++ b/sprout/array/array.hpp @@ -91,7 +91,7 @@ namespace sprout { return fill(value); } SPROUT_CXX14_CONSTEXPR void swap(array& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(std::declval(), std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(std::declval(), std::declval())) { sprout::swap_ranges(other.begin(), other.end(), begin()); } @@ -226,7 +226,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::array& lhs, sprout::array& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/compressed_pair.hpp b/sprout/compressed_pair.hpp index 90473bac..3d69d235 100644 --- a/sprout/compressed_pair.hpp +++ b/sprout/compressed_pair.hpp @@ -87,7 +87,7 @@ namespace sprout { return second_; } SPROUT_CXX14_CONSTEXPR void swap(compressed_pair_impl& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(first_, other.first_)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(second_, other.second_)) ) @@ -138,7 +138,7 @@ namespace sprout { return second_; } SPROUT_CXX14_CONSTEXPR void swap(compressed_pair_impl& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(second_, other.second_))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(second_, other.second_)) { sprout::swap(second_, other.second_); } @@ -186,7 +186,7 @@ namespace sprout { return *this; } SPROUT_CXX14_CONSTEXPR void swap(compressed_pair_impl& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(first_, other.first_))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(first_, other.first_)) { sprout::swap(first_, other.first_); } @@ -317,7 +317,7 @@ namespace sprout { return second_; } SPROUT_CXX14_CONSTEXPR void swap(compressed_pair_impl& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(first_, other.first_)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(second_, other.second_)) ) @@ -450,7 +450,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::compressed_pair& lhs, sprout::compressed_pair& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/config/suffix.hpp b/sprout/config/suffix.hpp index 6bb49502..bb6f2ad3 100644 --- a/sprout/config/suffix.hpp +++ b/sprout/config/suffix.hpp @@ -106,17 +106,26 @@ // // SPROUT_NOEXCEPT +// SPROUT_NOEXCEPT_OR_NOTHROW +// SPROUT_NOEXCEPT_IF // SPROUT_NOEXCEPT_EXPR // SPROUT_NOEXCEPT_EXPR_OR_DEFAULT +// SPROUT_NOEXCEPT_IF_EXPR // #ifndef SPROUT_CONFIG_DISABLE_NOEXCEPT # define SPROUT_NOEXCEPT noexcept -# define SPROUT_NOEXCEPT_EXPR(EXPR) noexcept(EXPR) -# define SPROUT_NOEXCEPT_EXPR_OR_DEFAULT(EXPR, C) noexcept(EXPR) +# define SPROUT_NOEXCEPT_OR_NOTHROW noexcept +# define SPROUT_NOEXCEPT_IF(COND) noexcept((COND)) +# define SPROUT_NOEXCEPT_EXPR(EXPR) noexcept((EXPR)) +# define SPROUT_NOEXCEPT_EXPR_OR_DEFAULT(EXPR, C) noexcept((EXPR)) +# define SPROUT_NOEXCEPT_IF_EXPR(EXPR) noexcept(noexcept((EXPR))) #else // #ifndef SPROUT_CONFIG_DISABLE_NOEXCEPT # define SPROUT_NOEXCEPT -# define SPROUT_NOEXCEPT_EXPR(EXPR) +# define SPROUT_NOEXCEPT_OR_NOTHROW throw() +# define SPROUT_NOEXCEPT_IF(COND) +# define SPROUT_NOEXCEPT_EXPR(EXPR) false # define SPROUT_NOEXCEPT_EXPR_OR_DEFAULT(EXPR, C) C +# define SPROUT_NOEXCEPT_IF_EXPR(EXPR) #endif // #ifndef SPROUT_CONFIG_DISABLE_NOEXCEPT // diff --git a/sprout/container/container_holder.hpp b/sprout/container/container_holder.hpp index 57cf4b10..bb71214a 100644 --- a/sprout/container/container_holder.hpp +++ b/sprout/container/container_holder.hpp @@ -53,7 +53,7 @@ namespace sprout { container_holder(container_holder const&) = default; SPROUT_CXX14_CONSTEXPR void swap(container_holder& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(other.container, container))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(other.container, container)) { sprout::swap(other.container, container); } @@ -127,7 +127,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::container_holder& lhs, sprout::container_holder& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/ctype/functor.hpp b/sprout/ctype/functor.hpp index d1f37b70..e933c6b9 100644 --- a/sprout/ctype/functor.hpp +++ b/sprout/ctype/functor.hpp @@ -431,7 +431,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(sprout::tolower(std::declval()) == sprout::tolower(std::declval())) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tolower(std::declval()) == sprout::tolower(std::declval()))) + const SPROUT_NOEXCEPT_IF_EXPR(sprout::tolower(std::declval()) == sprout::tolower(std::declval())) { return sprout::tolower(SPROUT_FORWARD(T, x)) == sprout::tolower(SPROUT_FORWARD(U, y)); } @@ -457,7 +457,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(sprout::tolower(std::declval()) != sprout::tolower(std::declval())) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tolower(std::declval()) != sprout::tolower(std::declval()))) + const SPROUT_NOEXCEPT_IF_EXPR(sprout::tolower(std::declval()) != sprout::tolower(std::declval())) { return sprout::tolower(SPROUT_FORWARD(T, x)) != sprout::tolower(SPROUT_FORWARD(U, y)); } diff --git a/sprout/darkroom/access/access.hpp b/sprout/darkroom/access/access.hpp index 61c99c82..7e7447ae 100644 --- a/sprout/darkroom/access/access.hpp +++ b/sprout/darkroom/access/access.hpp @@ -44,7 +44,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto get(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::get(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::tuples::get(SPROUT_FORWARD(T, t))) -> decltype(sprout::tuples::get(SPROUT_FORWARD(T, t))) { return sprout::tuples::get(SPROUT_FORWARD(T, t)); diff --git a/sprout/darkroom/colors/rgb.hpp b/sprout/darkroom/colors/rgb.hpp index 72ce7e4b..dae2ddbc 100644 --- a/sprout/darkroom/colors/rgb.hpp +++ b/sprout/darkroom/colors/rgb.hpp @@ -38,7 +38,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto r(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t)); @@ -46,7 +46,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto g(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t)); @@ -54,7 +54,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto b(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t)); @@ -68,7 +68,7 @@ namespace sprout { > inline SPROUT_CONSTEXPR auto a(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<3>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<3>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<3>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<3>(SPROUT_FORWARD(T, t)); @@ -79,7 +79,7 @@ namespace sprout { > inline SPROUT_CONSTEXPR typename sprout::darkroom::access::unit::type a(T&&) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(typename sprout::darkroom::access::unit::type())) + SPROUT_NOEXCEPT_IF_EXPR(typename sprout::darkroom::access::unit::type()) { return typename sprout::darkroom::access::unit::type(); } diff --git a/sprout/darkroom/coords/vector.hpp b/sprout/darkroom/coords/vector.hpp index 722efb5e..2ce56142 100644 --- a/sprout/darkroom/coords/vector.hpp +++ b/sprout/darkroom/coords/vector.hpp @@ -26,7 +26,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto x(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t)); @@ -34,7 +34,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto y(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t)); @@ -42,7 +42,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto z(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t)); diff --git a/sprout/darkroom/intersects/intersection.hpp b/sprout/darkroom/intersects/intersection.hpp index 30d8ef29..190813b0 100644 --- a/sprout/darkroom/intersects/intersection.hpp +++ b/sprout/darkroom/intersects/intersection.hpp @@ -51,7 +51,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto does_intersect(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t)); @@ -59,7 +59,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto distance(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t)); @@ -67,7 +67,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto point_of_intersection(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t)); @@ -75,7 +75,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto normal(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<3>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<3>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<3>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<3>(SPROUT_FORWARD(T, t)); @@ -83,7 +83,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto material(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<4>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<4>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<4>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<4>(SPROUT_FORWARD(T, t)); @@ -94,7 +94,7 @@ namespace sprout { > inline SPROUT_CONSTEXPR auto is_from_inside(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<5>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<5>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<5>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<5>(SPROUT_FORWARD(T, t)); @@ -105,7 +105,7 @@ namespace sprout { > inline SPROUT_CONSTEXPR typename sprout::darkroom::access::element<5, sprout::darkroom::intersects::intersection>::type is_from_inside(T&&) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR((typename sprout::darkroom::access::element<5, sprout::darkroom::intersects::intersection>::type()))) + SPROUT_NOEXCEPT_IF_EXPR((typename sprout::darkroom::access::element<5, sprout::darkroom::intersects::intersection>::type())) { return typename sprout::darkroom::access::element<5, sprout::darkroom::intersects::intersection>::type(); } diff --git a/sprout/darkroom/materials/material.hpp b/sprout/darkroom/materials/material.hpp index afda503a..2a568709 100644 --- a/sprout/darkroom/materials/material.hpp +++ b/sprout/darkroom/materials/material.hpp @@ -58,7 +58,7 @@ namespace sprout { > inline SPROUT_CONSTEXPR auto color(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t)); @@ -69,7 +69,7 @@ namespace sprout { > inline SPROUT_CONSTEXPR typename sprout::darkroom::access::element<0, sprout::darkroom::materials::material>::type color(T&&) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR((typename sprout::darkroom::access::element<0, sprout::darkroom::materials::material>::type()))) + SPROUT_NOEXCEPT_IF_EXPR((typename sprout::darkroom::access::element<0, sprout::darkroom::materials::material>::type())) { return typename sprout::darkroom::access::element<0, sprout::darkroom::materials::material>::type(); } @@ -82,7 +82,7 @@ namespace sprout { > inline SPROUT_CONSTEXPR auto reflection(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t)); @@ -93,7 +93,7 @@ namespace sprout { > inline SPROUT_CONSTEXPR typename sprout::darkroom::access::element<1, sprout::darkroom::materials::material>::type reflection(T&&) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR((typename sprout::darkroom::access::element<1, sprout::darkroom::materials::material>::type()))) + SPROUT_NOEXCEPT_IF_EXPR((typename sprout::darkroom::access::element<1, sprout::darkroom::materials::material>::type())) { return typename sprout::darkroom::access::element<1, sprout::darkroom::materials::material>::type(); } @@ -106,7 +106,7 @@ namespace sprout { > inline SPROUT_CONSTEXPR auto alpha(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<2>(SPROUT_FORWARD(T, t)); @@ -117,7 +117,7 @@ namespace sprout { > inline SPROUT_CONSTEXPR typename sprout::darkroom::access::element<2, sprout::darkroom::materials::material>::type alpha(T&&) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR((typename sprout::darkroom::access::element<2, sprout::darkroom::materials::material>::type()))) + SPROUT_NOEXCEPT_IF_EXPR((typename sprout::darkroom::access::element<2, sprout::darkroom::materials::material>::type())) { return typename sprout::darkroom::access::element<2, sprout::darkroom::materials::material>::type(); } @@ -130,7 +130,7 @@ namespace sprout { > inline SPROUT_CONSTEXPR auto refraction(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<3>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<3>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<3>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<3>(SPROUT_FORWARD(T, t)); @@ -141,7 +141,7 @@ namespace sprout { > inline SPROUT_CONSTEXPR typename sprout::darkroom::access::element<3, sprout::darkroom::materials::material>::type refraction(T&&) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR((typename sprout::darkroom::access::element<3, sprout::darkroom::materials::material>::type()))) + SPROUT_NOEXCEPT_IF_EXPR((typename sprout::darkroom::access::element<3, sprout::darkroom::materials::material>::type())) { return typename sprout::darkroom::access::element<3, sprout::darkroom::materials::material>::type(); } diff --git a/sprout/darkroom/rays/ray.hpp b/sprout/darkroom/rays/ray.hpp index cd638e2b..be514c50 100644 --- a/sprout/darkroom/rays/ray.hpp +++ b/sprout/darkroom/rays/ray.hpp @@ -25,7 +25,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto position(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<0>(SPROUT_FORWARD(T, t)); @@ -33,7 +33,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto direction(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t))) -> decltype(sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t))) { return sprout::darkroom::access::get<1>(SPROUT_FORWARD(T, t)); diff --git a/sprout/detail/integer/integer_mask.hpp b/sprout/detail/integer/integer_mask.hpp index 72ca903e..7b7f98e0 100644 --- a/sprout/detail/integer/integer_mask.hpp +++ b/sprout/detail/integer/integer_mask.hpp @@ -38,11 +38,11 @@ namespace sprout { SPROUT_STATIC_CONSTEXPR std::size_t bit_count = Bits; }; -#define SPROUT_LOW_BITS_MASK_SPECIALIZE(Type) \ +#define SPROUT_LOW_BITS_MASK_SPECIALIZE(TYPE) \ template<> \ - struct low_bits_mask_t::digits> { \ + struct low_bits_mask_t::digits> { \ public: \ - typedef sprout::numeric_limits limits_type; \ + typedef sprout::numeric_limits limits_type; \ typedef typename sprout::detail::uint_t::least least; \ typedef typename sprout::detail::uint_t::fast fast; \ public: \ diff --git a/sprout/detail/predef.hpp b/sprout/detail/predef.hpp index e0f90b0a..ceaf926a 100644 --- a/sprout/detail/predef.hpp +++ b/sprout/detail/predef.hpp @@ -13,8 +13,8 @@ // // SPROUT_VERSION_NUMBER // -#define SPROUT_VERSION_NUMBER(major, minor, patch) \ - ((((major) % 100) * 10000000) + (((minor) % 100) * 100000) + ((patch) % 100000)) +#define SPROUT_VERSION_NUMBER(MAJOR, MINOR, PATCH) \ + ((((MAJOR) % 100) * 10000000) + (((MINOR) % 100) * 100000) + ((PATCH) % 100000)) // // SPROUT_VERSION_NUMBER_ZERO // @@ -42,14 +42,14 @@ // SPROUT_GCC_OR_LATER // #if SPROUT_AVAILABLE_GCC -# define SPROUT_GCC_EARLIER(major, minor, patch) \ - (SPROUT_VERSION_GCC < SPROUT_VERSION_NUMBER(major, minor, patch)) -# define SPROUT_GCC_OR_LATER(major, minor, patch) \ - (SPROUT_VERSION_GCC >= SPROUT_VERSION_NUMBER(major, minor, patch)) +# define SPROUT_GCC_EARLIER(MAJOR, MINOR, PATCH) \ + (SPROUT_VERSION_GCC < SPROUT_VERSION_NUMBER(MAJOR, MINOR, PATCH)) +# define SPROUT_GCC_OR_LATER(MAJOR, MINOR, PATCH) \ + (SPROUT_VERSION_GCC >= SPROUT_VERSION_NUMBER(MAJOR, MINOR, PATCH)) #else -# define SPROUT_GCC_EARLIER(major, minor, patch) \ +# define SPROUT_GCC_EARLIER(MAJOR, MINOR, PATCH) \ (0) -# define SPROUT_GCC_OR_LATER(major, minor, patch) \ +# define SPROUT_GCC_OR_LATER(MAJOR, MINOR, PATCH) \ (0) #endif // @@ -92,14 +92,14 @@ // SPROUT_CLANG_OR_LATER // #if SPROUT_AVAILABLE_CLANG -# define SPROUT_CLANG_EARLIER(major, minor, patch) \ - (SPROUT_VERSION_CLANG < SPROUT_VERSION_NUMBER(major, minor, patch)) -# define SPROUT_CLANG_OR_LATER(major, minor, patch) \ - (SPROUT_VERSION_CLANG >= SPROUT_VERSION_NUMBER(major, minor, patch)) +# define SPROUT_CLANG_EARLIER(MAJOR, MINOR, PATCH) \ + (SPROUT_VERSION_CLANG < SPROUT_VERSION_NUMBER(MAJOR, MINOR, PATCH)) +# define SPROUT_CLANG_OR_LATER(MAJOR, MINOR, PATCH) \ + (SPROUT_VERSION_CLANG >= SPROUT_VERSION_NUMBER(MAJOR, MINOR, PATCH)) #else -# define SPROUT_CLANG_EARLIER(major, minor, patch) \ +# define SPROUT_CLANG_EARLIER(MAJOR, MINOR, PATCH) \ (0) -# define SPROUT_CLANG_OR_LATER(major, minor, patch) \ +# define SPROUT_CLANG_OR_LATER(MAJOR, MINOR, PATCH) \ (0) #endif // diff --git a/sprout/forward_clist.hpp b/sprout/forward_clist.hpp index 50305ba5..16a09ec4 100644 --- a/sprout/forward_clist.hpp +++ b/sprout/forward_clist.hpp @@ -96,7 +96,7 @@ namespace sprout { return forward_item_iterator(item->next); } SPROUT_CXX14_CONSTEXPR void swap(forward_item_iterator& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(item, other.item))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(item, other.item)) { sprout::swap(item, other.item); } @@ -143,7 +143,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::detail::forward_item_iterator& lhs, sprout::detail::forward_item_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } @@ -240,7 +240,10 @@ namespace sprout { {} SPROUT_CXX14_CONSTEXPR void swap(item& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(val, other.val)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(next, other.next))) + SPROUT_NOEXCEPT_IF( + SPROUT_NOEXCEPT_EXPR(sprout::swap(val, other.val)) + && SPROUT_NOEXCEPT_EXPR(sprout::swap(next, other.next)) + ) { sprout::swap(val, other.val); sprout::swap(next, other.next); diff --git a/sprout/functional/address_of.hpp b/sprout/functional/address_of.hpp index 9f6ed682..a096ee5c 100644 --- a/sprout/functional/address_of.hpp +++ b/sprout/functional/address_of.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(&std::declval()) operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(&std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(&std::declval()) { return &SPROUT_FORWARD(T, x); } diff --git a/sprout/functional/assign.hpp b/sprout/functional/assign.hpp index 020ac8c1..b4a6be5e 100644 --- a/sprout/functional/assign.hpp +++ b/sprout/functional/assign.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() = std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() = std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() = std::declval()) { return SPROUT_FORWARD(T, x) = SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/bit_and.hpp b/sprout/functional/bit_and.hpp index c8a30455..9d93d0b9 100644 --- a/sprout/functional/bit_and.hpp +++ b/sprout/functional/bit_and.hpp @@ -34,7 +34,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() & std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() & std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() & std::declval()) { return SPROUT_FORWARD(T, x) & SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/bit_and_assign.hpp b/sprout/functional/bit_and_assign.hpp index c2d130e5..4ffd761e 100644 --- a/sprout/functional/bit_and_assign.hpp +++ b/sprout/functional/bit_and_assign.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() &= std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() &= std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() &= std::declval()) { return SPROUT_FORWARD(T, x) &= SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/bit_not.hpp b/sprout/functional/bit_not.hpp index 36049834..52af0e7a 100644 --- a/sprout/functional/bit_not.hpp +++ b/sprout/functional/bit_not.hpp @@ -33,7 +33,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(~std::declval()) operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(~std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(~std::declval()) { return ~SPROUT_FORWARD(T, x); } diff --git a/sprout/functional/bit_or.hpp b/sprout/functional/bit_or.hpp index 511c85ee..70be9af9 100644 --- a/sprout/functional/bit_or.hpp +++ b/sprout/functional/bit_or.hpp @@ -34,7 +34,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() | std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() | std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() | std::declval()) { return SPROUT_FORWARD(T, x) | SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/bit_or_assign.hpp b/sprout/functional/bit_or_assign.hpp index a184693e..4ac80433 100644 --- a/sprout/functional/bit_or_assign.hpp +++ b/sprout/functional/bit_or_assign.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() |= std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() |= std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() |= std::declval()) { return SPROUT_FORWARD(T, x) |= SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/bit_xor.hpp b/sprout/functional/bit_xor.hpp index 1223ef36..f298f316 100644 --- a/sprout/functional/bit_xor.hpp +++ b/sprout/functional/bit_xor.hpp @@ -34,7 +34,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() ^ std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() ^ std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() ^ std::declval()) { return SPROUT_FORWARD(T, x) ^ SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/bit_xor_assign.hpp b/sprout/functional/bit_xor_assign.hpp index 29fa9e22..a6be5aaa 100644 --- a/sprout/functional/bit_xor_assign.hpp +++ b/sprout/functional/bit_xor_assign.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() ^= std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() ^= std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() ^= std::declval()) { return SPROUT_FORWARD(T, x) ^= SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/call_fun.hpp b/sprout/functional/call_fun.hpp index 87d2f5f8..8df88326 100644 --- a/sprout/functional/call_fun.hpp +++ b/sprout/functional/call_fun.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval()(std::declval()...)) operator()(F&& f, As&&... as) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval()(std::declval()...))) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval()(std::declval()...)) { return SPROUT_FORWARD(F, f)(SPROUT_FORWARD(As, as)...); } diff --git a/sprout/functional/comma.hpp b/sprout/functional/comma.hpp index 1ec44060..7a0f7008 100644 --- a/sprout/functional/comma.hpp +++ b/sprout/functional/comma.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval(), std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR((std::declval(), std::declval()))) + const SPROUT_NOEXCEPT_IF_EXPR((std::declval(), std::declval())) { return SPROUT_FORWARD(T, x), SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/cond.hpp b/sprout/functional/cond.hpp index 587bc946..76702062 100644 --- a/sprout/functional/cond.hpp +++ b/sprout/functional/cond.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() ? std::declval() : std::declval()) operator()(T&& x, U&& y, V&& z) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() ? std::declval() : std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() ? std::declval() : std::declval()) { return SPROUT_FORWARD(T, x) ? SPROUT_FORWARD(U, y) : SPROUT_FORWARD(V, z); } diff --git a/sprout/functional/dereference.hpp b/sprout/functional/dereference.hpp index f253678b..ad5ff278 100644 --- a/sprout/functional/dereference.hpp +++ b/sprout/functional/dereference.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(*std::declval()) operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(*std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(*std::declval()) { return *SPROUT_FORWARD(T, x); } diff --git a/sprout/functional/divides.hpp b/sprout/functional/divides.hpp index d86c5c37..8e8b5308 100644 --- a/sprout/functional/divides.hpp +++ b/sprout/functional/divides.hpp @@ -36,7 +36,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() / std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() / std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() / std::declval()) { return SPROUT_FORWARD(T, x) / SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/divides_assign.hpp b/sprout/functional/divides_assign.hpp index 3305989e..7b3b4491 100644 --- a/sprout/functional/divides_assign.hpp +++ b/sprout/functional/divides_assign.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() /= std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() /= std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() /= std::declval()) { return SPROUT_FORWARD(T, x) /= SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/equal_to.hpp b/sprout/functional/equal_to.hpp index 4c9d5780..2138be76 100644 --- a/sprout/functional/equal_to.hpp +++ b/sprout/functional/equal_to.hpp @@ -36,7 +36,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() == std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() == std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() == std::declval()) { return SPROUT_FORWARD(T, x) == SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/greater.hpp b/sprout/functional/greater.hpp index e1a6d054..f1fb6086 100644 --- a/sprout/functional/greater.hpp +++ b/sprout/functional/greater.hpp @@ -36,7 +36,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() > std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() > std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() > std::declval()) { return SPROUT_FORWARD(T, x) > SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/greater_equal.hpp b/sprout/functional/greater_equal.hpp index a382e2fd..8045deb9 100644 --- a/sprout/functional/greater_equal.hpp +++ b/sprout/functional/greater_equal.hpp @@ -36,7 +36,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() >= std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() >= std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() >= std::declval()) { return SPROUT_FORWARD(T, x) >= SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/hash/hash.hpp b/sprout/functional/hash/hash.hpp index 3b55f15e..ccad08db 100644 --- a/sprout/functional/hash/hash.hpp +++ b/sprout/functional/hash/hash.hpp @@ -48,31 +48,31 @@ namespace sprout { template SPROUT_CONSTEXPR std::size_t operator()(T&& v) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::to_hash(SPROUT_FORWARD(T, v)))) + const SPROUT_NOEXCEPT_IF_EXPR(sprout::to_hash(SPROUT_FORWARD(T, v))) { return sprout::to_hash(SPROUT_FORWARD(T, v)); } }; -#define SPROUT_HASH_SPECIALIZE(type) \ +#define SPROUT_HASH_SPECIALIZE(TYPE) \ template<> \ - struct hash { \ + struct hash { \ public: \ - typedef type argument_type; \ + typedef TYPE argument_type; \ typedef std::size_t result_type; \ public: \ - SPROUT_CONSTEXPR std::size_t operator()(type v) const { \ + SPROUT_CONSTEXPR std::size_t operator()(TYPE v) const { \ return sprout::to_hash(v); \ } \ } -#define SPROUT_HASH_SPECIALIZE_REF(type) \ +#define SPROUT_HASH_SPECIALIZE_REF(TYPE) \ template<> \ - struct hash { \ + struct hash { \ public: \ - typedef type argument_type; \ + typedef TYPE argument_type; \ typedef std::size_t result_type; \ public: \ - SPROUT_CONSTEXPR std::size_t operator()(type const& v) const { \ + SPROUT_CONSTEXPR std::size_t operator()(TYPE const& v) const { \ return sprout::to_hash(v); \ } \ } diff --git a/sprout/functional/less.hpp b/sprout/functional/less.hpp index 6d205eea..81731ca6 100644 --- a/sprout/functional/less.hpp +++ b/sprout/functional/less.hpp @@ -36,7 +36,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() < std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() < std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() < std::declval()) { return SPROUT_FORWARD(T, x) < SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/less_equal.hpp b/sprout/functional/less_equal.hpp index b257c50a..62da6b96 100644 --- a/sprout/functional/less_equal.hpp +++ b/sprout/functional/less_equal.hpp @@ -36,7 +36,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() <= std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() <= std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() <= std::declval()) { return SPROUT_FORWARD(T, x) <= SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/logical_and.hpp b/sprout/functional/logical_and.hpp index 5c202035..9e98f898 100644 --- a/sprout/functional/logical_and.hpp +++ b/sprout/functional/logical_and.hpp @@ -34,7 +34,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() && std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() && std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() && std::declval()) { return SPROUT_FORWARD(T, x) && SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/logical_not.hpp b/sprout/functional/logical_not.hpp index a9e4eace..634bcd9e 100644 --- a/sprout/functional/logical_not.hpp +++ b/sprout/functional/logical_not.hpp @@ -33,7 +33,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(!std::declval()) operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(!std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(!std::declval()) { return !SPROUT_FORWARD(T, x); } diff --git a/sprout/functional/logical_or.hpp b/sprout/functional/logical_or.hpp index fb1e743e..8abff121 100644 --- a/sprout/functional/logical_or.hpp +++ b/sprout/functional/logical_or.hpp @@ -34,7 +34,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() || std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() || std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() || std::declval()) { return SPROUT_FORWARD(T, x) || SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/mem_ptr.hpp b/sprout/functional/mem_ptr.hpp index dc37e71e..c7328e11 100644 --- a/sprout/functional/mem_ptr.hpp +++ b/sprout/functional/mem_ptr.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval()->*std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval()->*std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval()->*std::declval()) { return SPROUT_FORWARD(T, x)->*SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/member.hpp b/sprout/functional/member.hpp index 129111ed..5302d440 100644 --- a/sprout/functional/member.hpp +++ b/sprout/functional/member.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval().*std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval().*std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval().*std::declval()) { return SPROUT_FORWARD(T, x).*SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/minus.hpp b/sprout/functional/minus.hpp index d6d9e72d..de8ce606 100644 --- a/sprout/functional/minus.hpp +++ b/sprout/functional/minus.hpp @@ -36,7 +36,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() - std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() - std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() - std::declval()) { return SPROUT_FORWARD(T, x) - SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/minus_assign.hpp b/sprout/functional/minus_assign.hpp index 8b21c289..b479a019 100644 --- a/sprout/functional/minus_assign.hpp +++ b/sprout/functional/minus_assign.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() -= std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() -= std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() -= std::declval()) { return SPROUT_FORWARD(T, x) -= SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/modulus.hpp b/sprout/functional/modulus.hpp index df1740fe..e55be03e 100644 --- a/sprout/functional/modulus.hpp +++ b/sprout/functional/modulus.hpp @@ -36,7 +36,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() % std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() % std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() % std::declval()) { return SPROUT_FORWARD(T, x) % SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/modulus_assign.hpp b/sprout/functional/modulus_assign.hpp index 26decd50..f0d71116 100644 --- a/sprout/functional/modulus_assign.hpp +++ b/sprout/functional/modulus_assign.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() %= std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() %= std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() %= std::declval()) { return SPROUT_FORWARD(T, x) %= SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/multiplies.hpp b/sprout/functional/multiplies.hpp index ce53451f..8920c430 100644 --- a/sprout/functional/multiplies.hpp +++ b/sprout/functional/multiplies.hpp @@ -36,7 +36,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() * std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() * std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() * std::declval()) { return SPROUT_FORWARD(T, x) * SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/multiplies_assign.hpp b/sprout/functional/multiplies_assign.hpp index 98519a90..39da8aee 100644 --- a/sprout/functional/multiplies_assign.hpp +++ b/sprout/functional/multiplies_assign.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() *= std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() *= std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() *= std::declval()) { return SPROUT_FORWARD(T, x) *= SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/negate.hpp b/sprout/functional/negate.hpp index ce806f18..386919f5 100644 --- a/sprout/functional/negate.hpp +++ b/sprout/functional/negate.hpp @@ -35,7 +35,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(-std::declval()) operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(-std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(-std::declval()) { return -SPROUT_FORWARD(T, x); } diff --git a/sprout/functional/not_equal_to.hpp b/sprout/functional/not_equal_to.hpp index 898fc231..9fe861ca 100644 --- a/sprout/functional/not_equal_to.hpp +++ b/sprout/functional/not_equal_to.hpp @@ -36,7 +36,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() != std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() != std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() != std::declval()) { return SPROUT_FORWARD(T, x) != SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/plus.hpp b/sprout/functional/plus.hpp index 790e8a32..fd04b51f 100644 --- a/sprout/functional/plus.hpp +++ b/sprout/functional/plus.hpp @@ -36,7 +36,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() + std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() + std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() + std::declval()) { return SPROUT_FORWARD(T, x) + SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/plus_assign.hpp b/sprout/functional/plus_assign.hpp index 78b20bff..c8cfd0f3 100644 --- a/sprout/functional/plus_assign.hpp +++ b/sprout/functional/plus_assign.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() += std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() += std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() += std::declval()) { return SPROUT_FORWARD(T, x) += SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/polymorphic/bind1st.hpp b/sprout/functional/polymorphic/bind1st.hpp index 336b4837..7b18c783 100644 --- a/sprout/functional/polymorphic/bind1st.hpp +++ b/sprout/functional/polymorphic/bind1st.hpp @@ -30,7 +30,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(op(value, std::declval())) operator()(Arg&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(op(value, std::declval()))) + const SPROUT_NOEXCEPT_IF_EXPR(op(value, std::declval())) { return op(value, SPROUT_FORWARD(Arg, x)); } diff --git a/sprout/functional/polymorphic/bind2nd.hpp b/sprout/functional/polymorphic/bind2nd.hpp index 85e68f9e..e391bee8 100644 --- a/sprout/functional/polymorphic/bind2nd.hpp +++ b/sprout/functional/polymorphic/bind2nd.hpp @@ -30,7 +30,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(op(std::declval(), value)) operator()(Arg&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(op(std::declval(), value))) + const SPROUT_NOEXCEPT_IF_EXPR(op(std::declval(), value)) { return op(SPROUT_FORWARD(Arg, x), value); } diff --git a/sprout/functional/posite.hpp b/sprout/functional/posite.hpp index e1fc8025..e4231bc2 100644 --- a/sprout/functional/posite.hpp +++ b/sprout/functional/posite.hpp @@ -35,7 +35,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(+std::declval()) operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(+std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(+std::declval()) { return +SPROUT_FORWARD(T, x); } diff --git a/sprout/functional/post_dec.hpp b/sprout/functional/post_dec.hpp index f7299556..498e3f27 100644 --- a/sprout/functional/post_dec.hpp +++ b/sprout/functional/post_dec.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(~std::declval()--) operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(~std::declval()--)) + const SPROUT_NOEXCEPT_IF_EXPR(~std::declval()--) { return SPROUT_FORWARD(T, x)--; } diff --git a/sprout/functional/post_inc.hpp b/sprout/functional/post_inc.hpp index 8cf07ff2..eeac75e3 100644 --- a/sprout/functional/post_inc.hpp +++ b/sprout/functional/post_inc.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval()++) operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval()++)) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval()++) { return SPROUT_FORWARD(T, x)++; } diff --git a/sprout/functional/pre_dec.hpp b/sprout/functional/pre_dec.hpp index d2731579..89584506 100644 --- a/sprout/functional/pre_dec.hpp +++ b/sprout/functional/pre_dec.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(--std::declval()) operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(--std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(--std::declval()) { return --SPROUT_FORWARD(T, x); } diff --git a/sprout/functional/pre_inc.hpp b/sprout/functional/pre_inc.hpp index a0047b2a..31043d74 100644 --- a/sprout/functional/pre_inc.hpp +++ b/sprout/functional/pre_inc.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(++std::declval()) operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(++std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(++std::declval()) { return ++SPROUT_FORWARD(T, x); } diff --git a/sprout/functional/shift_left.hpp b/sprout/functional/shift_left.hpp index e0d44f71..3b3611a6 100644 --- a/sprout/functional/shift_left.hpp +++ b/sprout/functional/shift_left.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() << std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() << std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() << std::declval()) { return SPROUT_FORWARD(T, x) << SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/shift_left_assign.hpp b/sprout/functional/shift_left_assign.hpp index 62c0e2ce..9ce6e1a1 100644 --- a/sprout/functional/shift_left_assign.hpp +++ b/sprout/functional/shift_left_assign.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() <<= std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() <<= std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() <<= std::declval()) { return SPROUT_FORWARD(T, x) <<= SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/shift_right.hpp b/sprout/functional/shift_right.hpp index 5e430274..fdb71308 100644 --- a/sprout/functional/shift_right.hpp +++ b/sprout/functional/shift_right.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() >> std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() << std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() << std::declval()) { return SPROUT_FORWARD(T, x) >> SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/shift_right_assign.hpp b/sprout/functional/shift_right_assign.hpp index f63ac6e6..6e831d77 100644 --- a/sprout/functional/shift_right_assign.hpp +++ b/sprout/functional/shift_right_assign.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval() >>= std::declval()) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() >>= std::declval())) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval() >>= std::declval()) { return SPROUT_FORWARD(T, x) >>= SPROUT_FORWARD(U, y); } diff --git a/sprout/functional/subscript.hpp b/sprout/functional/subscript.hpp index 76bdd9f1..5f516beb 100644 --- a/sprout/functional/subscript.hpp +++ b/sprout/functional/subscript.hpp @@ -26,7 +26,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(std::declval()[std::declval()]) operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval()[std::declval()])) + const SPROUT_NOEXCEPT_IF_EXPR(std::declval()[std::declval()]) { return SPROUT_FORWARD(T, x)[SPROUT_FORWARD(U, y)]; } diff --git a/sprout/generator/generated_value.hpp b/sprout/generator/generated_value.hpp index 710843dc..461ebe9d 100644 --- a/sprout/generator/generated_value.hpp +++ b/sprout/generator/generated_value.hpp @@ -25,7 +25,7 @@ namespace sprout_generator_detail { template inline SPROUT_CONSTEXPR decltype(sprout::generators::generator_access_traits::get_generated_value(std::declval())) get_generated_value(Gen& gen) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::generator_access_traits::get_generated_value(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::generators::generator_access_traits::get_generated_value(std::declval())) { return sprout::generators::generator_access_traits::get_generated_value(gen); } @@ -35,14 +35,14 @@ namespace sprout_generator_detail { decltype(sprout::generators::generator_access_traits::type>::get_generated_value(std::declval())) >::type get_generated_value(Gen&& gen) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::generator_access_traits::type>::get_generated_value(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::generators::generator_access_traits::type>::get_generated_value(std::declval())) { return sprout::generators::generator_access_traits::get_generated_value(gen); } template inline SPROUT_CONSTEXPR decltype(sprout::generators::generator_access_traits::get_generated_value(std::declval())) get_generated_value(Gen const& gen) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::generator_access_traits::get_generated_value(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::generators::generator_access_traits::get_generated_value(std::declval())) { return sprout::generators::generator_access_traits::get_generated_value(gen); } @@ -50,7 +50,7 @@ namespace sprout_generator_detail { template inline SPROUT_CONSTEXPR decltype(get_generated_value(std::declval())) call_get_generated_value(Gen& gen) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(get_generated_value(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(get_generated_value(std::declval())) { return get_generated_value(gen); } @@ -60,14 +60,14 @@ namespace sprout_generator_detail { decltype(get_generated_value(std::declval())) >::type call_get_generated_value(Gen&& gen) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(get_generated_value(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(get_generated_value(std::declval())) { return get_generated_value(gen); } template inline SPROUT_CONSTEXPR decltype(get_generated_value(std::declval())) call_get_generated_value(Gen const& gen) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(get_generated_value(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(get_generated_value(std::declval())) { return get_generated_value(gen); } @@ -88,7 +88,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR decltype(sprout_generator_detail::call_get_generated_value(std::declval())) generated_value(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout_generator_detail::call_get_generated_value(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout_generator_detail::call_get_generated_value(std::declval())) { return sprout_generator_detail::call_get_generated_value(SPROUT_FORWARD(T, t)); } diff --git a/sprout/generator/generator_access_traits.hpp b/sprout/generator/generator_access_traits.hpp index aec278b0..f62594a2 100644 --- a/sprout/generator/generator_access_traits.hpp +++ b/sprout/generator/generator_access_traits.hpp @@ -50,19 +50,19 @@ namespace sprout { public: static SPROUT_CONSTEXPR decltype(std::declval().generated_value()) get_generated_value(Gen& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval().generated_value())) + SPROUT_NOEXCEPT_IF_EXPR(std::declval().generated_value()) { return t.generated_value(); } static SPROUT_CONSTEXPR decltype(std::declval().generated_value()) get_generated_value(Gen&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval().generated_value())) + SPROUT_NOEXCEPT_IF_EXPR(std::declval().generated_value()) { return t.generated_value(); } static SPROUT_CONSTEXPR decltype(std::declval().generated_value()) get_generated_value(Gen const& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval().generated_value())) + SPROUT_NOEXCEPT_IF_EXPR(std::declval().generated_value()) { return t.generated_value(); } @@ -75,19 +75,19 @@ namespace sprout { public: static SPROUT_CONSTEXPR decltype(sprout::tuples::get<0>(std::declval())) get_generated_value(Gen& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::get<0>(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::tuples::get<0>(std::declval())) { return sprout::tuples::get<0>(t); } static SPROUT_CONSTEXPR decltype(sprout::tuples::get<0>(std::declval())) get_generated_value(Gen&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::get<0>(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::tuples::get<0>(std::declval())) { return sprout::tuples::get<0>(t); } static SPROUT_CONSTEXPR decltype(sprout::tuples::get<0>(std::declval())) get_generated_value(Gen const& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::get<0>(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::tuples::get<0>(std::declval())) { return sprout::tuples::get<0>(t); } @@ -125,19 +125,19 @@ namespace sprout { public: static SPROUT_CONSTEXPR decltype(std::declval().next_generator()) get_next_generator(Gen& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval().next_generator())) + SPROUT_NOEXCEPT_IF_EXPR(std::declval().next_generator()) { return t.next_generator(); } static SPROUT_CONSTEXPR decltype(std::declval().next_generator()) get_next_generator(Gen&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval().next_generator())) + SPROUT_NOEXCEPT_IF_EXPR(std::declval().next_generator()) { return t.next_generator(); } static SPROUT_CONSTEXPR decltype(std::declval().next_generator()) get_next_generator(Gen const& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval().next_generator())) + SPROUT_NOEXCEPT_IF_EXPR(std::declval().next_generator()) { return t.next_generator(); } @@ -150,19 +150,19 @@ namespace sprout { public: static SPROUT_CONSTEXPR decltype(sprout::tuples::get<1>(std::declval())) get_next_generator(Gen& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::get<1>(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::tuples::get<1>(std::declval())) { return sprout::tuples::get<1>(t); } static SPROUT_CONSTEXPR decltype(sprout::tuples::get<1>(std::declval())) get_next_generator(Gen&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::get<1>(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::tuples::get<1>(std::declval())) { return sprout::tuples::get<1>(t); } static SPROUT_CONSTEXPR decltype(sprout::tuples::get<1>(std::declval())) get_next_generator(Gen const& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::get<1>(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::tuples::get<1>(std::declval())) { return sprout::tuples::get<1>(t); } @@ -182,13 +182,13 @@ namespace sprout { public: static SPROUT_CONSTEXPR decltype(sprout::generators::generator_access_traits::get_generated_value(std::declval())) get_generated_value(Gen const& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::generator_access_traits::get_generated_value(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::generators::generator_access_traits::get_generated_value(std::declval())) { return sprout::generators::generator_access_traits::get_generated_value(t); } static SPROUT_CONSTEXPR decltype(sprout::generators::generator_access_traits::get_next_generator(std::declval())) get_next_generator(Gen const& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::generator_access_traits::get_next_generator(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::generators::generator_access_traits::get_next_generator(std::declval())) { return sprout::generators::generator_access_traits::get_next_generator(t); } diff --git a/sprout/generator/next_generator.hpp b/sprout/generator/next_generator.hpp index 012b826f..0fb548a6 100644 --- a/sprout/generator/next_generator.hpp +++ b/sprout/generator/next_generator.hpp @@ -25,7 +25,7 @@ namespace sprout_generator_detail { template inline SPROUT_CONSTEXPR decltype(sprout::generators::generator_access_traits::get_next_generator(std::declval())) get_next_generator(Gen& gen) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::generator_access_traits::get_next_generator(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::generators::generator_access_traits::get_next_generator(std::declval())) { return sprout::generators::generator_access_traits::get_next_generator(gen); } @@ -35,14 +35,14 @@ namespace sprout_generator_detail { decltype(sprout::generators::generator_access_traits::type>::get_next_generator(std::declval())) >::type get_next_generator(Gen&& gen) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::generator_access_traits::type>::get_next_generator(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::generators::generator_access_traits::type>::get_next_generator(std::declval())) { return sprout::generators::generator_access_traits::get_next_generator(gen); } template inline SPROUT_CONSTEXPR decltype(sprout::generators::generator_access_traits::get_next_generator(std::declval())) get_next_generator(Gen const& gen) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::generator_access_traits::get_next_generator(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::generators::generator_access_traits::get_next_generator(std::declval())) { return sprout::generators::generator_access_traits::get_next_generator(gen); } @@ -50,7 +50,7 @@ namespace sprout_generator_detail { template inline SPROUT_CONSTEXPR decltype(get_next_generator(std::declval())) call_get_next_generator(Gen& gen) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(get_next_generator(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(get_next_generator(std::declval())) { return get_next_generator(gen); } @@ -60,14 +60,14 @@ namespace sprout_generator_detail { decltype(get_next_generator(std::declval())) >::type call_get_next_generator(Gen&& gen) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(get_next_generator(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(get_next_generator(std::declval())) { return get_next_generator(gen); } template inline SPROUT_CONSTEXPR decltype(get_next_generator(std::declval())) call_get_next_generator(Gen const& gen) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(get_next_generator(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(get_next_generator(std::declval())) { return get_next_generator(gen); } @@ -88,7 +88,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR decltype(sprout_generator_detail::call_get_next_generator(std::declval())) next_generator(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout_generator_detail::call_get_next_generator(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout_generator_detail::call_get_next_generator(std::declval())) { return sprout_generator_detail::call_get_next_generator(SPROUT_FORWARD(T, t)); } diff --git a/sprout/iterator/adjacent_filter_iterator.hpp b/sprout/iterator/adjacent_filter_iterator.hpp index 190a76e8..ab03e7cf 100644 --- a/sprout/iterator/adjacent_filter_iterator.hpp +++ b/sprout/iterator/adjacent_filter_iterator.hpp @@ -124,7 +124,7 @@ namespace sprout { return adjacent_filter_iterator(pred, checked_next(find_next(current, last, pred), last), last, private_construct_t()); } SPROUT_CXX14_CONSTEXPR void swap(adjacent_filter_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(last, other.last)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(pred, other.pred)) @@ -168,7 +168,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::adjacent_filter_iterator& lhs, sprout::adjacent_filter_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/alternate_iterator.hpp b/sprout/iterator/alternate_iterator.hpp index b7343aa2..6c5aea82 100644 --- a/sprout/iterator/alternate_iterator.hpp +++ b/sprout/iterator/alternate_iterator.hpp @@ -160,7 +160,7 @@ namespace sprout { ; } SPROUT_CXX14_CONSTEXPR void swap(alternate_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current1, other.current1)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(current2, other.current2)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(in_left, other.in_left)) @@ -280,7 +280,7 @@ namespace sprout { sprout::alternate_iterator& lhs, sprout::alternate_iterator& rhs ) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/back_insert_iterator.hpp b/sprout/iterator/back_insert_iterator.hpp index 0669e73f..ffc5c568 100644 --- a/sprout/iterator/back_insert_iterator.hpp +++ b/sprout/iterator/back_insert_iterator.hpp @@ -77,7 +77,7 @@ namespace sprout { } SPROUT_CXX14_CONSTEXPR void swap(back_insert_iterator& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(base_type::swap(other))) + SPROUT_NOEXCEPT_IF_EXPR(base_type::swap(other)) { base_type::swap(other); } @@ -89,7 +89,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::back_insert_iterator& lhs, sprout::back_insert_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/bytes_iterator.hpp b/sprout/iterator/bytes_iterator.hpp index 92318d50..889ad182 100644 --- a/sprout/iterator/bytes_iterator.hpp +++ b/sprout/iterator/bytes_iterator.hpp @@ -101,7 +101,7 @@ namespace sprout { return bytes_iterator(it_, i_ - 1, prev_tag()); } SPROUT_CXX14_CONSTEXPR void swap(bytes_iterator& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(it_, other.it_))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(it_, other.it_)) { sprout::swap(it_, other.it_); sprout::swap(i_, other.i_); @@ -197,7 +197,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::bytes_iterator& lhs, sprout::bytes_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/clamp_iterator.hpp b/sprout/iterator/clamp_iterator.hpp index 7e130c65..e8e16eea 100644 --- a/sprout/iterator/clamp_iterator.hpp +++ b/sprout/iterator/clamp_iterator.hpp @@ -123,7 +123,7 @@ namespace sprout { return clamp_iterator(sprout::prev(current), low, up, comp); } SPROUT_CXX14_CONSTEXPR void swap(clamp_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(comp, other.comp)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(low, other.low)) @@ -216,7 +216,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::clamp_iterator& lhs, sprout::clamp_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/counting_iterator.hpp b/sprout/iterator/counting_iterator.hpp index 1c0edc25..b942e03e 100644 --- a/sprout/iterator/counting_iterator.hpp +++ b/sprout/iterator/counting_iterator.hpp @@ -120,7 +120,7 @@ namespace sprout { return counting_iterator(current_ - 1); } SPROUT_CXX14_CONSTEXPR void swap(counting_iterator& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(current_, other.current_))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(current_, other.current_)) { sprout::swap(current_, other.current_); } @@ -186,7 +186,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::counting_iterator& lhs, sprout::counting_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/dft_iterator.hpp b/sprout/iterator/dft_iterator.hpp index 6d6c98dd..6268acdd 100644 --- a/sprout/iterator/dft_iterator.hpp +++ b/sprout/iterator/dft_iterator.hpp @@ -75,7 +75,10 @@ namespace sprout { return dft_iterator(first_, last_, index_, index_ - 1, size_); } SPROUT_CXX14_CONSTEXPR void swap(dft_iterator& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(first_, other.first_)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(last_, other.last_))) + SPROUT_NOEXCEPT_IF( + SPROUT_NOEXCEPT_EXPR(sprout::swap(first_, other.first_)) + && SPROUT_NOEXCEPT_EXPR(sprout::swap(last_, other.last_)) + ) { sprout::swap(first_, other.first_); sprout::swap(last_, other.last_); @@ -182,7 +185,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::dft_iterator& lhs, sprout::dft_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/filter_iterator.hpp b/sprout/iterator/filter_iterator.hpp index dfe31f15..13079fd3 100644 --- a/sprout/iterator/filter_iterator.hpp +++ b/sprout/iterator/filter_iterator.hpp @@ -140,7 +140,7 @@ namespace sprout { return filter_iterator(pred, find_prev(sprout::prev(current), pred), last, private_construct_t()); } SPROUT_CXX14_CONSTEXPR void swap(filter_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(last, other.last)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(pred, other.pred)) @@ -184,7 +184,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::filter_iterator& lhs, sprout::filter_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/front_insert_iterator.hpp b/sprout/iterator/front_insert_iterator.hpp index 6ee7f321..f5f120bc 100644 --- a/sprout/iterator/front_insert_iterator.hpp +++ b/sprout/iterator/front_insert_iterator.hpp @@ -77,7 +77,7 @@ namespace sprout { } SPROUT_CXX14_CONSTEXPR void swap(front_insert_iterator& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(base_type::swap(other))) + SPROUT_NOEXCEPT_IF_EXPR(base_type::swap(other)) { base_type::swap(other); } @@ -89,7 +89,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::front_insert_iterator& lhs, sprout::front_insert_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/generator_iterator.hpp b/sprout/iterator/generator_iterator.hpp index c16e678f..551d7298 100644 --- a/sprout/iterator/generator_iterator.hpp +++ b/sprout/iterator/generator_iterator.hpp @@ -76,7 +76,7 @@ namespace sprout { return generated_value(); } SPROUT_CXX14_CONSTEXPR void swap(generator_iterator& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(gen_, other.gen_))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(gen_, other.gen_)) { sprout::swap(gen_, other.gen_); sprout::swap(index_, other.index_); @@ -141,7 +141,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::generator_iterator& lhs, sprout::generator_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/idft_iterator.hpp b/sprout/iterator/idft_iterator.hpp index fa85c5cf..90e1a294 100644 --- a/sprout/iterator/idft_iterator.hpp +++ b/sprout/iterator/idft_iterator.hpp @@ -75,7 +75,10 @@ namespace sprout { return idft_iterator(first_, last_, index_, index_ - 1, size_); } SPROUT_CXX14_CONSTEXPR void swap(idft_iterator& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(first_, other.first_)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(last_, other.last_))) + SPROUT_NOEXCEPT_IF( + SPROUT_NOEXCEPT_EXPR(sprout::swap(first_, other.first_)) + && SPROUT_NOEXCEPT_EXPR(sprout::swap(last_, other.last_)) + ) { sprout::swap(first_, other.first_); sprout::swap(last_, other.last_); @@ -182,7 +185,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::idft_iterator& lhs, sprout::idft_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/index_iterator.hpp b/sprout/iterator/index_iterator.hpp index d863b9ed..3b2c051a 100644 --- a/sprout/iterator/index_iterator.hpp +++ b/sprout/iterator/index_iterator.hpp @@ -123,7 +123,7 @@ namespace sprout { return index_iterator(holder_, index_ - 1); } SPROUT_CXX14_CONSTEXPR void swap(index_iterator& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(holder_, other.holder_))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(holder_, other.holder_)) { sprout::swap(holder_, other.holder_); sprout::swap(index_, other.index_); @@ -246,7 +246,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::index_iterator& lhs, sprout::index_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/indexed_iterator.hpp b/sprout/iterator/indexed_iterator.hpp index a7e1b86c..76215c54 100644 --- a/sprout/iterator/indexed_iterator.hpp +++ b/sprout/iterator/indexed_iterator.hpp @@ -124,7 +124,7 @@ namespace sprout { return indexed_iterator(sprout::prev(current), idx - 1); } SPROUT_CXX14_CONSTEXPR void swap(indexed_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(swap(idx, other.idx)) ) @@ -194,7 +194,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::indexed_iterator& lhs, sprout::indexed_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/insert_iterator.hpp b/sprout/iterator/insert_iterator.hpp index 39b3e287..cd1e5a86 100644 --- a/sprout/iterator/insert_iterator.hpp +++ b/sprout/iterator/insert_iterator.hpp @@ -84,7 +84,7 @@ namespace sprout { } SPROUT_CXX14_CONSTEXPR void swap(insert_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(base_type::swap(other)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(other.iter, iter)) ) @@ -100,7 +100,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::insert_iterator& lhs, sprout::insert_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/insert_range_iterator.hpp b/sprout/iterator/insert_range_iterator.hpp index 29843b12..1621e002 100644 --- a/sprout/iterator/insert_range_iterator.hpp +++ b/sprout/iterator/insert_range_iterator.hpp @@ -177,7 +177,7 @@ namespace sprout { ; } SPROUT_CXX14_CONSTEXPR void swap(insert_range_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current1, other.current1)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(pos1, other.pos1)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(current2, other.current2)) @@ -304,7 +304,7 @@ namespace sprout { sprout::insert_range_iterator& lhs, sprout::insert_range_iterator& rhs ) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/joint_iterator.hpp b/sprout/iterator/joint_iterator.hpp index d15e165d..c8187510 100644 --- a/sprout/iterator/joint_iterator.hpp +++ b/sprout/iterator/joint_iterator.hpp @@ -175,7 +175,7 @@ namespace sprout { ; } SPROUT_CXX14_CONSTEXPR void swap(joint_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current1, other.current1)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(last1, other.last1)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(first2, other.first2)) @@ -314,7 +314,7 @@ namespace sprout { sprout::joint_iterator& lhs, sprout::joint_iterator& rhs ) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/merge_iterator.hpp b/sprout/iterator/merge_iterator.hpp index f5d77434..6ff2febf 100644 --- a/sprout/iterator/merge_iterator.hpp +++ b/sprout/iterator/merge_iterator.hpp @@ -167,7 +167,7 @@ namespace sprout { ; } SPROUT_CXX14_CONSTEXPR void swap(merge_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current1, other.current1)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(lst1, other.lst1)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(current2, other.current2)) @@ -231,7 +231,7 @@ namespace sprout { sprout::merge_iterator& lhs, sprout::merge_iterator& rhs ) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/move_iterator.hpp b/sprout/iterator/move_iterator.hpp index 2e78eeb9..2dbf281d 100644 --- a/sprout/iterator/move_iterator.hpp +++ b/sprout/iterator/move_iterator.hpp @@ -113,7 +113,7 @@ namespace sprout { return move_iterator(sprout::prev(current)); } SPROUT_CXX14_CONSTEXPR void swap(move_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(swap(current, other.current)) ) { @@ -181,7 +181,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::move_iterator& lhs, sprout::move_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/next_iterator.hpp b/sprout/iterator/next_iterator.hpp index 03cb541c..0d7b0fe2 100644 --- a/sprout/iterator/next_iterator.hpp +++ b/sprout/iterator/next_iterator.hpp @@ -86,8 +86,9 @@ namespace sprout { return next_iterator(current); } SPROUT_CXX14_CONSTEXPR void swap(next_iterator& other) - SPROUT_NOEXCEPT_EXPR( - SPROUT_NOEXCEPT_EXPR(swap(holder_, other.holder_)) && SPROUT_NOEXCEPT_EXPR(swap(current, other.current)) + SPROUT_NOEXCEPT_IF( + SPROUT_NOEXCEPT_EXPR(swap(holder_, other.holder_)) + && SPROUT_NOEXCEPT_EXPR(swap(current, other.current)) ) { swap(holder_, other.holder_); @@ -121,7 +122,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::next_iterator& lhs, sprout::next_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/ptr_index_iterator.hpp b/sprout/iterator/ptr_index_iterator.hpp index b1a320e5..95d536e1 100644 --- a/sprout/iterator/ptr_index_iterator.hpp +++ b/sprout/iterator/ptr_index_iterator.hpp @@ -211,7 +211,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::ptr_index_iterator& lhs, sprout::ptr_index_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/remake_iterator.hpp b/sprout/iterator/remake_iterator.hpp index 44b93750..eb70cb6a 100644 --- a/sprout/iterator/remake_iterator.hpp +++ b/sprout/iterator/remake_iterator.hpp @@ -201,7 +201,7 @@ namespace sprout { ); } SPROUT_CXX14_CONSTEXPR void swap(remake_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(swap(current2, other.current2)) && SPROUT_NOEXCEPT_EXPR(swap(fst, other.fst)) @@ -327,7 +327,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::remake_iterator& lhs, sprout::remake_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/reverse_iterator.hpp b/sprout/iterator/reverse_iterator.hpp index dd970fef..5ad70c58 100644 --- a/sprout/iterator/reverse_iterator.hpp +++ b/sprout/iterator/reverse_iterator.hpp @@ -112,7 +112,7 @@ namespace sprout { return reverse_iterator(sprout::next(current)); } SPROUT_CXX14_CONSTEXPR void swap(reverse_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(swap(current, other.current)) ) { @@ -180,7 +180,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::reverse_iterator& lhs, sprout::reverse_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/sawtooth_iterator.hpp b/sprout/iterator/sawtooth_iterator.hpp index cfc42c98..d82afa55 100644 --- a/sprout/iterator/sawtooth_iterator.hpp +++ b/sprout/iterator/sawtooth_iterator.hpp @@ -203,7 +203,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::sawtooth_iterator& lhs, sprout::sawtooth_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/set_difference_iterator.hpp b/sprout/iterator/set_difference_iterator.hpp index f0823fb0..b0bc6268 100644 --- a/sprout/iterator/set_difference_iterator.hpp +++ b/sprout/iterator/set_difference_iterator.hpp @@ -131,7 +131,7 @@ namespace sprout { ); } SPROUT_CXX14_CONSTEXPR void swap(set_difference_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(lst1, other.lst1)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(lst2, other.lst2)) @@ -191,7 +191,7 @@ namespace sprout { sprout::set_difference_iterator& lhs, sprout::set_difference_iterator& rhs ) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/set_intersection_iterator.hpp b/sprout/iterator/set_intersection_iterator.hpp index 0747324f..190412ca 100644 --- a/sprout/iterator/set_intersection_iterator.hpp +++ b/sprout/iterator/set_intersection_iterator.hpp @@ -131,7 +131,7 @@ namespace sprout { ); } SPROUT_CXX14_CONSTEXPR void swap(set_intersection_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(lst1, other.lst1)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(lst2, other.lst2)) @@ -191,7 +191,7 @@ namespace sprout { sprout::set_intersection_iterator& lhs, sprout::set_intersection_iterator& rhs ) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/set_symmetric_difference_iterator.hpp b/sprout/iterator/set_symmetric_difference_iterator.hpp index 23b88ee9..f149e86e 100644 --- a/sprout/iterator/set_symmetric_difference_iterator.hpp +++ b/sprout/iterator/set_symmetric_difference_iterator.hpp @@ -198,7 +198,7 @@ namespace sprout { ); } SPROUT_CXX14_CONSTEXPR void swap(set_symmetric_difference_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(lst1, other.lst1)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(lst2, other.lst2)) @@ -259,7 +259,7 @@ namespace sprout { sprout::set_symmetric_difference_iterator& lhs, sprout::set_symmetric_difference_iterator& rhs ) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/set_union_iterator.hpp b/sprout/iterator/set_union_iterator.hpp index 12aa8e98..b5377c92 100644 --- a/sprout/iterator/set_union_iterator.hpp +++ b/sprout/iterator/set_union_iterator.hpp @@ -148,7 +148,7 @@ namespace sprout { ); } SPROUT_CXX14_CONSTEXPR void swap(set_union_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(lst1, other.lst1)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(lst2, other.lst2)) @@ -209,7 +209,7 @@ namespace sprout { sprout::set_union_iterator& lhs, sprout::set_union_iterator& rhs ) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/sinusoid_iterator.hpp b/sprout/iterator/sinusoid_iterator.hpp index 105659a8..4fc31235 100644 --- a/sprout/iterator/sinusoid_iterator.hpp +++ b/sprout/iterator/sinusoid_iterator.hpp @@ -209,7 +209,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::sinusoid_iterator& lhs, sprout::sinusoid_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/size_enum_iterator.hpp b/sprout/iterator/size_enum_iterator.hpp index 22bcbf49..0f1fb762 100644 --- a/sprout/iterator/size_enum_iterator.hpp +++ b/sprout/iterator/size_enum_iterator.hpp @@ -123,7 +123,7 @@ namespace sprout { return size_enum_iterator(sprout::prev(current)); } SPROUT_CXX14_CONSTEXPR void swap(size_enum_iterator& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(current, other.current)) { sprout::swap(current, other.current); } @@ -268,7 +268,7 @@ namespace sprout { ; } SPROUT_CXX14_CONSTEXPR void swap(size_enum_iterator& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(current, other.current)) { sprout::swap(current, other.current); sprout::swap(sep_size, other.sep_size); @@ -408,7 +408,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::size_enum_iterator& lhs, sprout::size_enum_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/square_iterator.hpp b/sprout/iterator/square_iterator.hpp index 22e4ddd9..7cf38a8b 100644 --- a/sprout/iterator/square_iterator.hpp +++ b/sprout/iterator/square_iterator.hpp @@ -213,7 +213,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::square_iterator& lhs, sprout::square_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/step_iterator.hpp b/sprout/iterator/step_iterator.hpp index 7d9517f1..76dc37c2 100644 --- a/sprout/iterator/step_iterator.hpp +++ b/sprout/iterator/step_iterator.hpp @@ -158,7 +158,7 @@ namespace sprout { return step_iterator(*this, -1); } SPROUT_CXX14_CONSTEXPR void swap(step_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(swap(last, other.last)) && SPROUT_NOEXCEPT_EXPR(swap(wid, other.wid)) @@ -235,7 +235,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::step_iterator& lhs, sprout::step_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/transform_iterator.hpp b/sprout/iterator/transform_iterator.hpp index c8c11dff..ddb2f04d 100644 --- a/sprout/iterator/transform_iterator.hpp +++ b/sprout/iterator/transform_iterator.hpp @@ -158,7 +158,7 @@ namespace sprout { return transform_iterator(sprout::prev(current), sprout::prev(current2), func); } SPROUT_CXX14_CONSTEXPR void swap(transform_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(current2, other.current2)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(func, other.func)) @@ -285,7 +285,7 @@ namespace sprout { return transform_iterator(sprout::prev(current), func); } SPROUT_CXX14_CONSTEXPR void swap(transform_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(func, other.func)) ) @@ -404,7 +404,7 @@ namespace sprout { sprout::transform_iterator& lhs, sprout::transform_iterator& rhs ) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/triangle_iterator.hpp b/sprout/iterator/triangle_iterator.hpp index 06413ab9..b207685a 100644 --- a/sprout/iterator/triangle_iterator.hpp +++ b/sprout/iterator/triangle_iterator.hpp @@ -227,7 +227,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::triangle_iterator& lhs, sprout::triangle_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/value_iterator.hpp b/sprout/iterator/value_iterator.hpp index f58e53ff..842f0d24 100644 --- a/sprout/iterator/value_iterator.hpp +++ b/sprout/iterator/value_iterator.hpp @@ -86,7 +86,7 @@ namespace sprout { return value_iterator(holder_, index_ + 1); } SPROUT_CXX14_CONSTEXPR void swap(value_iterator& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(holder_, other.holder_))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(holder_, other.holder_)) { sprout::swap(holder_, other.holder_); sprout::swap(index_, other.index_); @@ -185,7 +185,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::value_iterator& lhs, sprout::value_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/valued_iterator.hpp b/sprout/iterator/valued_iterator.hpp index 59d049a5..9b6eea11 100644 --- a/sprout/iterator/valued_iterator.hpp +++ b/sprout/iterator/valued_iterator.hpp @@ -132,7 +132,7 @@ namespace sprout { return valued_iterator(sprout::prev(current), holder); } SPROUT_CXX14_CONSTEXPR void swap(valued_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(swap(holder, other.holder)) ) @@ -202,7 +202,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::valued_iterator& lhs, sprout::valued_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/iterator/while_iterator.hpp b/sprout/iterator/while_iterator.hpp index b42765cc..ed5fdca3 100644 --- a/sprout/iterator/while_iterator.hpp +++ b/sprout/iterator/while_iterator.hpp @@ -146,7 +146,7 @@ namespace sprout { return while_iterator(pred, find_prev(sprout::prev(current), pred), last, private_construct_t()); } SPROUT_CXX14_CONSTEXPR void swap(while_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(current, other.current)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(last, other.last)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(pred, other.pred)) @@ -190,7 +190,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::while_iterator& lhs, sprout::while_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/optional/optional.hpp b/sprout/optional/optional.hpp index 7300f313..c6517724 100644 --- a/sprout/optional/optional.hpp +++ b/sprout/optional/optional.hpp @@ -111,7 +111,7 @@ namespace sprout { optional(optional&&) = default; #else SPROUT_CONSTEXPR optional(optional&& v) - SPROUT_NOEXCEPT_EXPR(std::is_nothrow_move_constructible::value) + SPROUT_NOEXCEPT_IF(std::is_nothrow_move_constructible::value) : init(v.init) , val(v.is_initialized() ? holder_type(sprout::move(get(v))) : holder_type()) {} @@ -170,7 +170,7 @@ namespace sprout { return *this; } SPROUT_CXX14_CONSTEXPR optional& operator=(optional&& v) - SPROUT_NOEXCEPT_EXPR(std::is_move_constructible::value && std::is_move_assignable::value) + SPROUT_NOEXCEPT_IF(std::is_move_constructible::value && std::is_move_assignable::value) { assign(SPROUT_FORWARD(optional, v)); return *this; @@ -220,7 +220,7 @@ namespace sprout { temp.swap(*this); } SPROUT_CXX14_CONSTEXPR void assign(optional&& v) - SPROUT_NOEXCEPT_EXPR(std::is_move_constructible::value && std::is_move_assignable::value) + SPROUT_NOEXCEPT_IF(std::is_move_constructible::value && std::is_move_assignable::value) { optional temp(SPROUT_FORWARD(optional, v)); temp.swap(*this); @@ -261,7 +261,7 @@ namespace sprout { } // 20.6.4.4, swap SPROUT_CXX14_CONSTEXPR void swap(optional& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(val, other.val))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(val, other.val)) { sprout::swap(init, other.init); sprout::swap(val, other.val); @@ -355,7 +355,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::optional& lhs, sprout::optional& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/pit/pit.hpp b/sprout/pit/pit.hpp index fcb594c9..b81edfce 100644 --- a/sprout/pit/pit.hpp +++ b/sprout/pit/pit.hpp @@ -71,7 +71,7 @@ namespace sprout { return *this; } SPROUT_CXX14_CONSTEXPR void swap(pit& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(elem, other.elem))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(elem, other.elem)) { sprout::swap(elem, other.elem); } @@ -169,7 +169,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::pit& lhs, sprout::pit& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/pit/tuple.hpp b/sprout/pit/tuple.hpp index 11baee47..770d6ecf 100644 --- a/sprout/pit/tuple.hpp +++ b/sprout/pit/tuple.hpp @@ -36,7 +36,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR typename sprout::container_traits >::value_type&& tuple_get(sprout::pit&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::move(sprout::tuples::get(t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::move(sprout::tuples::get(t))) { return sprout::move(sprout::tuples::get(t)); } diff --git a/sprout/random/random_result.hpp b/sprout/random/random_result.hpp index b5f99bfa..51d73973 100644 --- a/sprout/random/random_result.hpp +++ b/sprout/random/random_result.hpp @@ -129,7 +129,7 @@ namespace sprout { return distribution().max(); } SPROUT_CXX14_CONSTEXPR void swap(random_result& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(result_, other.result_)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(generator_, other.generator_)) ) @@ -259,7 +259,7 @@ namespace sprout { return !(lhs == rhs); } SPROUT_CXX14_CONSTEXPR void swap(random_result& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(result_, other.result_)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(generator_, other.generator_)) ) @@ -292,7 +292,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::random::random_result& lhs, sprout::random::random_result& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/random/results.hpp b/sprout/random/results.hpp index 0776a0c6..fe8a4c3a 100644 --- a/sprout/random/results.hpp +++ b/sprout/random/results.hpp @@ -21,7 +21,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR decltype(sprout::generators::generated_value(std::declval())) result(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::generated_value(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::generators::generated_value(std::declval())) { return sprout::generators::generated_value(SPROUT_FORWARD(T, t)); } @@ -32,7 +32,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR decltype(sprout::generators::next_generator(std::declval())) next(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::next_generator(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::generators::next_generator(std::declval())) { return sprout::generators::next_generator(SPROUT_FORWARD(T, t)); } diff --git a/sprout/random/variate_generator.hpp b/sprout/random/variate_generator.hpp index 2c6442d0..fe05e18b 100644 --- a/sprout/random/variate_generator.hpp +++ b/sprout/random/variate_generator.hpp @@ -76,7 +76,7 @@ namespace sprout { return distribution_.max(); } SPROUT_CXX14_CONSTEXPR void swap(variate_generator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(engine_, other.engine_)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(distribution_, other.distribution_)) ) @@ -100,7 +100,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::random::variate_generator& lhs, sprout::random::variate_generator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/range/range_container.hpp b/sprout/range/range_container.hpp index cc448e6b..cd4889ea 100644 --- a/sprout/range/range_container.hpp +++ b/sprout/range/range_container.hpp @@ -60,7 +60,7 @@ namespace sprout { template SPROUT_CXX14_CONSTEXPR void swap(range_container& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(other.first_, first_)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(other.last_, last_)) ) diff --git a/sprout/static_warning.hpp b/sprout/static_warning.hpp index 6da4f6ef..c5bd5d9f 100644 --- a/sprout/static_warning.hpp +++ b/sprout/static_warning.hpp @@ -33,17 +33,17 @@ namespace sprout { // // SPROUT_STATIC_WARNING // -#define SPROUT_STATIC_WARNING_IMPL_2(cond, msg, line) \ - struct sprout_static_warning_line_ ## line { \ - struct msg {}; \ - sprout_static_warning_line_ ## line() { \ - ::sprout::static_warning<(cond)>:: \ - warn(); \ +#define SPROUT_STATIC_WARNING_IMPL_2(COND, MSG, LINE) \ + struct sprout_static_warning_line_ ## LINE { \ + struct MSG {}; \ + sprout_static_warning_line_ ## LINE() { \ + ::sprout::static_warning<(COND)>:: \ + warn(); \ } \ } -#define SPROUT_STATIC_WARNING_IMPL(cond, msg) \ - SPROUT_STATIC_WARNING_IMPL_2(cond, msg, __LINE__) -#define SPROUT_STATIC_WARNING(cond) \ - SPROUT_STATIC_WARNING_IMPL(cond, static_warning_failed) +#define SPROUT_STATIC_WARNING_IMPL(COND, MSG) \ + SPROUT_STATIC_WARNING_IMPL_2(COND, MSG, __LINE__) +#define SPROUT_STATIC_WARNING(COND) \ + SPROUT_STATIC_WARNING_IMPL(COND, static_warning_failed) #endif // #ifndef SPROUT_STATIC_WARNING_HPP diff --git a/sprout/string/string.hpp b/sprout/string/string.hpp index 98e7bc3d..1eae83e7 100644 --- a/sprout/string/string.hpp +++ b/sprout/string/string.hpp @@ -591,7 +591,7 @@ namespace sprout { } SPROUT_CXX14_CONSTEXPR void swap(basic_string& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(std::declval(), std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(std::declval(), std::declval())) { sprout::swap_ranges(other.begin(), other.begin() + other.max_size(), begin()); sprout::swap(len, other.len); @@ -945,7 +945,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::basic_string& lhs, sprout::basic_string& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/string/to_string_value.hpp b/sprout/string/to_string_value.hpp index aac08ce2..cf7275d0 100644 --- a/sprout/string/to_string_value.hpp +++ b/sprout/string/to_string_value.hpp @@ -22,7 +22,7 @@ namespace sprout { template SPROUT_CONSTEXPR decltype(sprout::to_string(std::declval())) operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::to_string(std::declval()))) + const SPROUT_NOEXCEPT_IF_EXPR(sprout::to_string(std::declval())) { return sprout::to_string(SPROUT_FORWARD(T, x)); } diff --git a/sprout/sub_array/sub_array.hpp b/sprout/sub_array/sub_array.hpp index 36179133..d8676811 100644 --- a/sprout/sub_array/sub_array.hpp +++ b/sprout/sub_array/sub_array.hpp @@ -304,7 +304,7 @@ namespace sprout { } template SPROUT_CXX14_CONSTEXPR void swap(sub_array& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(other.array_, array_))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(other.array_, array_)) { sprout::swap(other.array_, array_); sprout::swap(other.to_first_, to_first_); @@ -425,7 +425,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::sub_array& lhs, sprout::sub_array& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/sub_array/tuple.hpp b/sprout/sub_array/tuple.hpp index 7145e6f4..d3d19352 100644 --- a/sprout/sub_array/tuple.hpp +++ b/sprout/sub_array/tuple.hpp @@ -27,7 +27,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR typename sprout::container_traits >::value_type& tuple_get(sprout::sub_array& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(*sprout::next(sprout::internal_begin(t), I))) + SPROUT_NOEXCEPT_IF_EXPR(*sprout::next(sprout::internal_begin(t), I)) { static_assert(I < sprout::container_traits >::static_size, "tuple_get: index out of range"); return *sprout::next(sprout::internal_begin(t), I); @@ -35,7 +35,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR typename sprout::container_traits >::value_type const& tuple_get(sprout::sub_array const& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(*sprout::next(sprout::internal_begin(t), I))) + SPROUT_NOEXCEPT_IF_EXPR(*sprout::next(sprout::internal_begin(t), I)) { static_assert(I < sprout::container_traits >::static_size, "tuple_get: index out of range"); return *sprout::next(sprout::internal_begin(t), I); @@ -43,7 +43,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR typename sprout::container_traits >::value_type&& tuple_get(sprout::sub_array&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::move(sprout::tuples::get(t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::move(sprout::tuples::get(t))) { return sprout::move(sprout::tuples::get(t)); } diff --git a/sprout/tuple/tuple/get.hpp b/sprout/tuple/tuple/get.hpp index 6398c2bd..85a27914 100644 --- a/sprout/tuple/tuple/get.hpp +++ b/sprout/tuple/tuple/get.hpp @@ -69,7 +69,7 @@ namespace sprout_tuple_detail { template inline SPROUT_CONSTEXPR typename sprout::tuples::tuple_traits::template lvalue_reference::type tuple_get(T& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::tuple_access_traits::template tuple_get(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::tuples::tuple_access_traits::template tuple_get(std::declval())) { return sprout::tuples::tuple_access_traits::template tuple_get(t); } @@ -79,14 +79,14 @@ namespace sprout_tuple_detail { typename sprout::tuples::tuple_traits::type>::template rvalue_reference::type >::type tuple_get(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::tuple_access_traits::type>::template tuple_get(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::tuples::tuple_access_traits::type>::template tuple_get(std::declval())) { return sprout::tuples::tuple_access_traits::template tuple_get(t); } template inline SPROUT_CONSTEXPR typename sprout::tuples::tuple_traits::template lvalue_reference::type tuple_get(T const& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::tuple_access_traits::template tuple_get(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::tuples::tuple_access_traits::template tuple_get(std::declval())) { return sprout::tuples::tuple_access_traits::template tuple_get(t); } @@ -94,7 +94,7 @@ namespace sprout_tuple_detail { template inline SPROUT_CONSTEXPR decltype(tuple_get(std::declval())) call_tuple_get(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(tuple_get(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(tuple_get(std::declval())) { return tuple_get(SPROUT_FORWARD(T, t)); } @@ -114,7 +114,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR decltype(sprout_tuple_detail::call_tuple_get(std::declval())) get(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout_tuple_detail::call_tuple_get(std::declval()))) + SPROUT_NOEXCEPT_IF_EXPR(sprout_tuple_detail::call_tuple_get(std::declval())) { return sprout_tuple_detail::call_tuple_get(SPROUT_FORWARD(T, t)); } diff --git a/sprout/tuple/tuple/tuple_decl.hpp b/sprout/tuple/tuple/tuple_decl.hpp index 7e59b008..f14dc9d0 100644 --- a/sprout/tuple/tuple/tuple_decl.hpp +++ b/sprout/tuple/tuple/tuple_decl.hpp @@ -29,6 +29,11 @@ namespace sprout { namespace tuples { namespace detail { + template + struct dummy_integral_constant + : public sprout::integral_constant + {}; + template class head_base; // EBO disabled @@ -166,7 +171,7 @@ namespace sprout { } public: SPROUT_CXX14_CONSTEXPR void swap(tuple_impl& t) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(sprout::swap(head(std::declval()), head(t))) && SPROUT_NOEXCEPT_EXPR(std::declval().swap(tail(t))) ) @@ -193,7 +198,7 @@ namespace sprout { tuple_impl(tuple_impl&&) = default; #else SPROUT_CONSTEXPR tuple_impl(tuple_impl&& t) - SPROUT_NOEXCEPT_EXPR(std::is_nothrow_move_constructible::value && std::is_nothrow_move_constructible::value) + SPROUT_NOEXCEPT_IF(std::is_nothrow_move_constructible::value && std::is_nothrow_move_constructible::value) : inherited_type(sprout::move(tail(t))) , base_type(SPROUT_FORWARD(Head, head(t))) {} @@ -222,7 +227,7 @@ namespace sprout { return *this; } SPROUT_CXX14_CONSTEXPR tuple_impl& operator=(tuple_impl&& t) - SPROUT_NOEXCEPT_EXPR(std::is_nothrow_move_assignable::value && std::is_nothrow_move_assignable::value) + SPROUT_NOEXCEPT_IF(std::is_nothrow_move_assignable::value && std::is_nothrow_move_assignable::value) { head(*this) = SPROUT_FORWARD(Head, head(t)); tail(*this) = sprout::move(tail(t)); @@ -447,7 +452,7 @@ namespace sprout { return *this; } SPROUT_CXX14_CONSTEXPR tuple& operator=(tuple&& rhs) - SPROUT_NOEXCEPT_EXPR(sprout::tpp::all_of...>::value) + SPROUT_NOEXCEPT_IF(sprout::tpp::all_of...>::value) { static_cast(*this) = sprout::move(rhs); return *this; @@ -488,7 +493,14 @@ namespace sprout { SPROUT_CXX14_CONSTEXPR tuple& operator=(sprout::pair&& rhs); // tuple swap SPROUT_CXX14_CONSTEXPR void swap(tuple& other) - SPROUT_NOEXCEPT_EXPR(sprout::tpp::all_of_c(), std::declval()), false)...>::value) + SPROUT_NOEXCEPT_IF( + sprout::tpp::all_of_c< + SPROUT_NOEXCEPT_EXPR_OR_DEFAULT( + sprout::swap(std::declval(), std::declval()), + (sprout::tuples::detail::dummy_integral_constant::value) + )... + >::value + ) { impl_type::swap(other); } @@ -520,7 +532,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::tuples::tuple& lhs, sprout::tuples::tuple& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/utility/pair/first.hpp b/sprout/utility/pair/first.hpp index 29a89ed6..3514aaf9 100644 --- a/sprout/utility/pair/first.hpp +++ b/sprout/utility/pair/first.hpp @@ -20,7 +20,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto first(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::get<0>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::tuples::get<0>(SPROUT_FORWARD(T, t))) -> decltype(sprout::tuples::get<0>(SPROUT_FORWARD(T, t))) { return sprout::tuples::get<0>(SPROUT_FORWARD(T, t)); diff --git a/sprout/utility/pair/pair_decl.hpp b/sprout/utility/pair/pair_decl.hpp index 1e164eff..1e6217ae 100644 --- a/sprout/utility/pair/pair_decl.hpp +++ b/sprout/utility/pair/pair_decl.hpp @@ -108,7 +108,7 @@ namespace sprout { return *this; } SPROUT_CXX14_CONSTEXPR pair& operator=(pair&& rhs) - SPROUT_NOEXCEPT_EXPR(std::is_nothrow_move_assignable::value && std::is_nothrow_move_assignable::value) + SPROUT_NOEXCEPT_IF(std::is_nothrow_move_assignable::value && std::is_nothrow_move_assignable::value) { first = SPROUT_FORWARD(T1, rhs.first); second = SPROUT_FORWARD(T2, rhs.second); @@ -149,10 +149,16 @@ namespace sprout { std::is_assignable::value && std::is_assignable::value >::type > - SPROUT_CXX14_CONSTEXPR pair& operator=(sprout::tuples::tuple&& rhs); + SPROUT_CXX14_CONSTEXPR pair& + operator=(sprout::tuples::tuple&& rhs); - SPROUT_CXX14_CONSTEXPR void swap(pair& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(first, other.first)) && SPROUT_NOEXCEPT_EXPR(sprout::swap(second, other.second))) { + SPROUT_CXX14_CONSTEXPR void + swap(pair& other) + SPROUT_NOEXCEPT_IF( + SPROUT_NOEXCEPT_EXPR(sprout::swap(first, other.first)) + && SPROUT_NOEXCEPT_EXPR(sprout::swap(second, other.second)) + ) + { sprout::swap(first, other.first); sprout::swap(second, other.second); } @@ -164,7 +170,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::pair& lhs, sprout::pair& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/utility/pair/second.hpp b/sprout/utility/pair/second.hpp index 57084b1e..25c8f0e3 100644 --- a/sprout/utility/pair/second.hpp +++ b/sprout/utility/pair/second.hpp @@ -20,7 +20,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR auto second(T&& t) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::get<1>(SPROUT_FORWARD(T, t)))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::tuples::get<1>(SPROUT_FORWARD(T, t))) -> decltype(sprout::tuples::get<1>(SPROUT_FORWARD(T, t))) { return sprout::tuples::get<1>(SPROUT_FORWARD(T, t)); diff --git a/sprout/utility/string_ref/string_ref.hpp b/sprout/utility/string_ref/string_ref.hpp index ff8ee896..976a6773 100644 --- a/sprout/utility/string_ref/string_ref.hpp +++ b/sprout/utility/string_ref/string_ref.hpp @@ -566,7 +566,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::basic_string_ref& lhs, sprout::basic_string_ref& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/utility/swap.hpp b/sprout/utility/swap.hpp index 09e373d3..d605a364 100644 --- a/sprout/utility/swap.hpp +++ b/sprout/utility/swap.hpp @@ -28,14 +28,14 @@ namespace sprout_swap_detail { template::value>::type = sprout::enabler> inline SPROUT_CXX14_CONSTEXPR void swap_impl(T& a, T& b) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(swap(a, b))) + SPROUT_NOEXCEPT_IF_EXPR(swap(a, b)) { swap(a, b); } template inline SPROUT_CXX14_CONSTEXPR void swap_impl(T (& a)[N], T (& b)[N]) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout_swap_detail::swap_impl(*a, *b))) + SPROUT_NOEXCEPT_IF_EXPR(sprout_swap_detail::swap_impl(*a, *b)) { for (std::size_t i = 0; i < N; ++i) { sprout_swap_detail::swap_impl(a[i], b[i]); @@ -50,7 +50,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(T1& lhs, T2& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout_swap_detail::swap_impl(lhs, rhs))) + SPROUT_NOEXCEPT_IF_EXPR(sprout_swap_detail::swap_impl(lhs, rhs)) { return sprout_swap_detail::swap_impl(lhs, rhs); } diff --git a/sprout/utility/value_holder/value_holder.hpp b/sprout/utility/value_holder/value_holder.hpp index deea2dad..d1685e4e 100644 --- a/sprout/utility/value_holder/value_holder.hpp +++ b/sprout/utility/value_holder/value_holder.hpp @@ -257,7 +257,7 @@ namespace sprout { } SPROUT_CXX14_CONSTEXPR void swap(value_holder& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(holder_, other.holder_))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(holder_, other.holder_)) { sprout::swap(holder_, other.holder_); } @@ -316,7 +316,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::value_holder& lhs, sprout::value_holder& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/uuid/uuid.hpp b/sprout/uuid/uuid.hpp index c287591d..f09a0254 100644 --- a/sprout/uuid/uuid.hpp +++ b/sprout/uuid/uuid.hpp @@ -273,7 +273,7 @@ namespace sprout { // inline SPROUT_CXX14_CONSTEXPR void swap(sprout::uuids::uuid& lhs, sprout::uuids::uuid& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/variant/variant.hpp b/sprout/variant/variant.hpp index 96a7f5c2..1795a8f7 100644 --- a/sprout/variant/variant.hpp +++ b/sprout/variant/variant.hpp @@ -64,7 +64,7 @@ namespace sprout { } public: SPROUT_CXX14_CONSTEXPR void swap(variant_impl& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(tuple_, other.tuple_))) + SPROUT_NOEXCEPT_IF_EXPR(sprout::swap(tuple_, other.tuple_)) { sprout::swap(tuple_, other.tuple_); sprout::swap(which_, other.which_); @@ -239,7 +239,7 @@ namespace sprout { {} // modifiers SPROUT_CXX14_CONSTEXPR void swap(variant& other) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval().swap(other))) + SPROUT_NOEXCEPT_IF_EXPR(std::declval().swap(other)) { impl_type::swap(other); } @@ -248,7 +248,7 @@ namespace sprout { return *this; } SPROUT_CXX14_CONSTEXPR variant& operator=(variant&& rhs) - SPROUT_NOEXCEPT_EXPR(std::is_nothrow_move_assignable::value) + SPROUT_NOEXCEPT_IF(std::is_nothrow_move_assignable::value) { static_cast(*this) = sprout::move(rhs); return *this; @@ -349,7 +349,7 @@ namespace sprout { template inline SPROUT_CXX14_CONSTEXPR void swap(sprout::variant& lhs, sprout::variant& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); } diff --git a/sprout/workaround/recursive_function_template.hpp b/sprout/workaround/recursive_function_template.hpp index e3a5ed39..c076d003 100644 --- a/sprout/workaround/recursive_function_template.hpp +++ b/sprout/workaround/recursive_function_template.hpp @@ -31,19 +31,19 @@ // SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE_DECL // SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK_DECL // -#define SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE_DECL(depth) \ - typename sprout::enabler_if<((depth) < SPROUT_RECURSIVE_FUNCTION_TEMPLATE_INSTANTIATION_LIMIT - 1)>::type -#define SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK_DECL(depth) \ - typename sprout::enabler_if<((depth) >= SPROUT_RECURSIVE_FUNCTION_TEMPLATE_INSTANTIATION_LIMIT - 1)>::type +#define SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE_DECL(DEPTH) \ + typename sprout::enabler_if<((DEPTH) < SPROUT_RECURSIVE_FUNCTION_TEMPLATE_INSTANTIATION_LIMIT - 1)>::type +#define SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK_DECL(DEPTH) \ + typename sprout::enabler_if<((DEPTH) >= SPROUT_RECURSIVE_FUNCTION_TEMPLATE_INSTANTIATION_LIMIT - 1)>::type // // SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE // SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK // -#define SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE(depth) \ - SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE_DECL(depth) = sprout::enabler -#define SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK(depth) \ - SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK_DECL(depth) = sprout::enabler +#define SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE(DEPTH) \ + SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE_DECL(DEPTH) = sprout::enabler +#define SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK(DEPTH) \ + SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK_DECL(DEPTH) = sprout::enabler // // SPROUT_RECURSIVE_FUNCTION_TEMPLATE_INSTANTIATION_EXCEEDED_MESSAGE diff --git a/testspr/iterator.hpp b/testspr/iterator.hpp index 43f5d9c4..00fe3b4b 100644 --- a/testspr/iterator.hpp +++ b/testspr/iterator.hpp @@ -112,7 +112,7 @@ namespace testspr { return reduct_iterator(sprout::prev(current)); } SPROUT_CXX14_CONSTEXPR void swap(reduct_iterator& other) - SPROUT_NOEXCEPT_EXPR( + SPROUT_NOEXCEPT_IF( SPROUT_NOEXCEPT_EXPR(swap(current, other.current)) ) { @@ -213,7 +213,7 @@ namespace testspr { template inline SPROUT_CXX14_CONSTEXPR void swap(testspr::reduct_iterator& lhs, testspr::reduct_iterator& rhs) - SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) + SPROUT_NOEXCEPT_IF_EXPR(lhs.swap(rhs)) { lhs.swap(rhs); }