diff --git a/sprout/functional/address_of.hpp b/sprout/functional/address_of.hpp index 98d655bf..80494728 100644 --- a/sprout/functional/address_of.hpp +++ b/sprout/functional/address_of.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct address_of; template<> - struct address_of { - public: - typedef void is_transparent; + struct address_of + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(&std::declval()) diff --git a/sprout/functional/assign.hpp b/sprout/functional/assign.hpp index 1055bb3a..094b0028 100644 --- a/sprout/functional/assign.hpp +++ b/sprout/functional/assign.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct assign; template<> - struct assign { - public: - typedef void is_transparent; + struct assign + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() = std::declval()) diff --git a/sprout/functional/bit_and.hpp b/sprout/functional/bit_and.hpp index a2867a89..1e77cb7a 100644 --- a/sprout/functional/bit_and.hpp +++ b/sprout/functional/bit_and.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // 20.8.7 bitwise operations @@ -27,9 +28,9 @@ namespace sprout { }; template<> - struct bit_and { - public: - typedef void is_transparent; + struct bit_and + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() & std::declval()) diff --git a/sprout/functional/bit_and_assign.hpp b/sprout/functional/bit_and_assign.hpp index 7860b85b..b80472e4 100644 --- a/sprout/functional/bit_and_assign.hpp +++ b/sprout/functional/bit_and_assign.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct bit_and_assign; template<> - struct bit_and_assign { - public: - typedef void is_transparent; + struct bit_and_assign + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() &= std::declval()) diff --git a/sprout/functional/bit_not.hpp b/sprout/functional/bit_not.hpp index dc85fa19..a4a3c8d6 100644 --- a/sprout/functional/bit_not.hpp +++ b/sprout/functional/bit_not.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // 20.8.7 bitwise operations @@ -26,9 +27,9 @@ namespace sprout { }; template<> - struct bit_not { - public: - typedef void is_transparent; + struct bit_not + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(~std::declval()) diff --git a/sprout/functional/bit_or.hpp b/sprout/functional/bit_or.hpp index 2db6ad8e..a5adf071 100644 --- a/sprout/functional/bit_or.hpp +++ b/sprout/functional/bit_or.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // 20.8.7 bitwise operations @@ -27,9 +28,9 @@ namespace sprout { }; template<> - struct bit_or { - public: - typedef void is_transparent; + struct bit_or + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() | std::declval()) diff --git a/sprout/functional/bit_or_assign.hpp b/sprout/functional/bit_or_assign.hpp index e8276d66..efd884a4 100644 --- a/sprout/functional/bit_or_assign.hpp +++ b/sprout/functional/bit_or_assign.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct bit_or_assign; template<> - struct bit_or_assign { - public: - typedef void is_transparent; + struct bit_or_assign + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() |= std::declval()) diff --git a/sprout/functional/bit_xor.hpp b/sprout/functional/bit_xor.hpp index 11454065..4d74e34c 100644 --- a/sprout/functional/bit_xor.hpp +++ b/sprout/functional/bit_xor.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // 20.8.7 bitwise operations @@ -27,9 +28,9 @@ namespace sprout { }; template<> - struct bit_xor { - public: - typedef void is_transparent; + struct bit_xor + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() ^ std::declval()) diff --git a/sprout/functional/bit_xor_assign.hpp b/sprout/functional/bit_xor_assign.hpp index edeb6968..763f95dd 100644 --- a/sprout/functional/bit_xor_assign.hpp +++ b/sprout/functional/bit_xor_assign.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct bit_xor_assign; template<> - struct bit_xor_assign { - public: - typedef void is_transparent; + struct bit_xor_assign + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() ^= std::declval()) diff --git a/sprout/functional/call_fun.hpp b/sprout/functional/call_fun.hpp index 37f5c26c..6974fb1f 100644 --- a/sprout/functional/call_fun.hpp +++ b/sprout/functional/call_fun.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct call_fun; template<> - struct call_fun { - public: - typedef void is_transparent; + struct call_fun + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval()(std::declval()...)) diff --git a/sprout/functional/comma.hpp b/sprout/functional/comma.hpp index 9ead2665..4f2b6ba4 100644 --- a/sprout/functional/comma.hpp +++ b/sprout/functional/comma.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct comma; template<> - struct comma { - public: - typedef void is_transparent; + struct comma + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval(), std::declval()) diff --git a/sprout/functional/cond.hpp b/sprout/functional/cond.hpp index 820f4bcc..eff5bd80 100644 --- a/sprout/functional/cond.hpp +++ b/sprout/functional/cond.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct cond; template<> - struct cond { - public: - typedef void is_transparent; + struct cond + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() ? std::declval() : std::declval()) diff --git a/sprout/functional/dereference.hpp b/sprout/functional/dereference.hpp index daccbc8d..326d17e5 100644 --- a/sprout/functional/dereference.hpp +++ b/sprout/functional/dereference.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct dereference; template<> - struct dereference { - public: - typedef void is_transparent; + struct dereference + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(*std::declval()) diff --git a/sprout/functional/divides.hpp b/sprout/functional/divides.hpp index b66813e0..57362593 100644 --- a/sprout/functional/divides.hpp +++ b/sprout/functional/divides.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace sprout { @@ -31,9 +32,9 @@ namespace sprout { }; template<> - struct divides { - public: - typedef void is_transparent; + struct divides + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() / std::declval()) diff --git a/sprout/functional/divides_assign.hpp b/sprout/functional/divides_assign.hpp index a8653ca1..0768b471 100644 --- a/sprout/functional/divides_assign.hpp +++ b/sprout/functional/divides_assign.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct divides_assign; template<> - struct divides_assign { - public: - typedef void is_transparent; + struct divides_assign + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() /= std::declval()) diff --git a/sprout/functional/equal_to.hpp b/sprout/functional/equal_to.hpp index 502dbb5d..529bea23 100644 --- a/sprout/functional/equal_to.hpp +++ b/sprout/functional/equal_to.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace sprout { @@ -31,9 +32,9 @@ namespace sprout { }; template<> - struct equal_to { - public: - typedef void is_transparent; + struct equal_to + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() == std::declval()) diff --git a/sprout/functional/greater.hpp b/sprout/functional/greater.hpp index fe3a5e0f..c834eae8 100644 --- a/sprout/functional/greater.hpp +++ b/sprout/functional/greater.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace sprout { @@ -31,9 +32,9 @@ namespace sprout { }; template<> - struct greater { - public: - typedef void is_transparent; + struct greater + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() > std::declval()) diff --git a/sprout/functional/greater_equal.hpp b/sprout/functional/greater_equal.hpp index 7f189c82..c7936fb0 100644 --- a/sprout/functional/greater_equal.hpp +++ b/sprout/functional/greater_equal.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace sprout { @@ -31,9 +32,9 @@ namespace sprout { }; template<> - struct greater_equal { - public: - typedef void is_transparent; + struct greater_equal + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() >= std::declval()) diff --git a/sprout/functional/less.hpp b/sprout/functional/less.hpp index 3663f4dd..fa24f51d 100644 --- a/sprout/functional/less.hpp +++ b/sprout/functional/less.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace sprout { @@ -31,9 +32,9 @@ namespace sprout { }; template<> - struct less { - public: - typedef void is_transparent; + struct less + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() < std::declval()) diff --git a/sprout/functional/less_equal.hpp b/sprout/functional/less_equal.hpp index 05a3bb22..937668da 100644 --- a/sprout/functional/less_equal.hpp +++ b/sprout/functional/less_equal.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace sprout { @@ -31,9 +32,9 @@ namespace sprout { }; template<> - struct less_equal { - public: - typedef void is_transparent; + struct less_equal + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() <= std::declval()) diff --git a/sprout/functional/logical_and.hpp b/sprout/functional/logical_and.hpp index 81688afe..188abe41 100644 --- a/sprout/functional/logical_and.hpp +++ b/sprout/functional/logical_and.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // 20.8.6 logical operations @@ -27,9 +28,9 @@ namespace sprout { }; template<> - struct logical_and { - public: - typedef void is_transparent; + struct logical_and + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() && std::declval()) diff --git a/sprout/functional/logical_not.hpp b/sprout/functional/logical_not.hpp index 78097624..58c378d6 100644 --- a/sprout/functional/logical_not.hpp +++ b/sprout/functional/logical_not.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // 20.8.6 logical operations @@ -26,9 +27,9 @@ namespace sprout { }; template<> - struct logical_not { - public: - typedef void is_transparent; + struct logical_not + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(!std::declval()) diff --git a/sprout/functional/logical_or.hpp b/sprout/functional/logical_or.hpp index dce786c1..44da757d 100644 --- a/sprout/functional/logical_or.hpp +++ b/sprout/functional/logical_or.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // 20.8.6 logical operations @@ -27,9 +28,9 @@ namespace sprout { }; template<> - struct logical_or { - public: - typedef void is_transparent; + struct logical_or + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() || std::declval()) diff --git a/sprout/functional/mem_ptr.hpp b/sprout/functional/mem_ptr.hpp index d1d26b1f..dc99f9f6 100644 --- a/sprout/functional/mem_ptr.hpp +++ b/sprout/functional/mem_ptr.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct mem_ptr; template<> - struct mem_ptr { - public: - typedef void is_transparent; + struct mem_ptr + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval()->*std::declval()) diff --git a/sprout/functional/member.hpp b/sprout/functional/member.hpp index c33d6ed7..e787f677 100644 --- a/sprout/functional/member.hpp +++ b/sprout/functional/member.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct member; template<> - struct member { - public: - typedef void is_transparent; + struct member + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval().*std::declval()) diff --git a/sprout/functional/minus.hpp b/sprout/functional/minus.hpp index c452a1c3..5c85a2d6 100644 --- a/sprout/functional/minus.hpp +++ b/sprout/functional/minus.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace sprout { @@ -31,9 +32,9 @@ namespace sprout { }; template<> - struct minus { - public: - typedef void is_transparent; + struct minus + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() - std::declval()) diff --git a/sprout/functional/minus_assign.hpp b/sprout/functional/minus_assign.hpp index 03ebb4d8..e50eda91 100644 --- a/sprout/functional/minus_assign.hpp +++ b/sprout/functional/minus_assign.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct minus_assign; template<> - struct minus_assign { - public: - typedef void is_transparent; + struct minus_assign + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() -= std::declval()) diff --git a/sprout/functional/modulus.hpp b/sprout/functional/modulus.hpp index 15a3f221..29ad45ca 100644 --- a/sprout/functional/modulus.hpp +++ b/sprout/functional/modulus.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace sprout { @@ -31,9 +32,9 @@ namespace sprout { }; template<> - struct modulus { - public: - typedef void is_transparent; + struct modulus + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() % std::declval()) diff --git a/sprout/functional/modulus_assign.hpp b/sprout/functional/modulus_assign.hpp index 8f1e0ff9..832b5ebf 100644 --- a/sprout/functional/modulus_assign.hpp +++ b/sprout/functional/modulus_assign.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct modulus_assign; template<> - struct modulus_assign { - public: - typedef void is_transparent; + struct modulus_assign + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() %= std::declval()) diff --git a/sprout/functional/multiplies.hpp b/sprout/functional/multiplies.hpp index b4611e83..a3d69967 100644 --- a/sprout/functional/multiplies.hpp +++ b/sprout/functional/multiplies.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace sprout { @@ -31,9 +32,9 @@ namespace sprout { }; template<> - struct multiplies { - public: - typedef void is_transparent; + struct multiplies + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() * std::declval()) diff --git a/sprout/functional/multiplies_assign.hpp b/sprout/functional/multiplies_assign.hpp index d788f448..a3311d9a 100644 --- a/sprout/functional/multiplies_assign.hpp +++ b/sprout/functional/multiplies_assign.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct multiplies_assign; template<> - struct multiplies_assign { - public: - typedef void is_transparent; + struct multiplies_assign + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() *= std::declval()) diff --git a/sprout/functional/negate.hpp b/sprout/functional/negate.hpp index 770896c7..db05660e 100644 --- a/sprout/functional/negate.hpp +++ b/sprout/functional/negate.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace sprout { @@ -30,9 +31,9 @@ namespace sprout { }; template<> - struct negate { - public: - typedef void is_transparent; + struct negate + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(-std::declval()) diff --git a/sprout/functional/plus.hpp b/sprout/functional/plus.hpp index e7ae7ab2..962450e4 100644 --- a/sprout/functional/plus.hpp +++ b/sprout/functional/plus.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace sprout { @@ -31,9 +32,9 @@ namespace sprout { }; template<> - struct plus { - public: - typedef void is_transparent; + struct plus + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() + std::declval()) diff --git a/sprout/functional/plus_assign.hpp b/sprout/functional/plus_assign.hpp index 72956124..1e257ed7 100644 --- a/sprout/functional/plus_assign.hpp +++ b/sprout/functional/plus_assign.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct plus_assign; template<> - struct plus_assign { - public: - typedef void is_transparent; + struct plus_assign + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() += std::declval()) diff --git a/sprout/functional/posite.hpp b/sprout/functional/posite.hpp index 09bf5945..b19e2539 100644 --- a/sprout/functional/posite.hpp +++ b/sprout/functional/posite.hpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace sprout { @@ -30,9 +31,9 @@ namespace sprout { }; template<> - struct posite { - public: - typedef void is_transparent; + struct posite + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(+std::declval()) diff --git a/sprout/functional/post_dec.hpp b/sprout/functional/post_dec.hpp index a994bab8..de474f7c 100644 --- a/sprout/functional/post_dec.hpp +++ b/sprout/functional/post_dec.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct post_dec; template<> - struct post_dec { - public: - typedef void is_transparent; + struct post_dec + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(~std::declval()--) diff --git a/sprout/functional/post_inc.hpp b/sprout/functional/post_inc.hpp index bf399269..f74fec33 100644 --- a/sprout/functional/post_inc.hpp +++ b/sprout/functional/post_inc.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct post_inc; template<> - struct post_inc { - public: - typedef void is_transparent; + struct post_inc + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval()++) diff --git a/sprout/functional/pre_dec.hpp b/sprout/functional/pre_dec.hpp index f2218246..39be5559 100644 --- a/sprout/functional/pre_dec.hpp +++ b/sprout/functional/pre_dec.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct pre_dec; template<> - struct pre_dec { - public: - typedef void is_transparent; + struct pre_dec + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(--std::declval()) diff --git a/sprout/functional/pre_inc.hpp b/sprout/functional/pre_inc.hpp index acb9b784..1d17f5d0 100644 --- a/sprout/functional/pre_inc.hpp +++ b/sprout/functional/pre_inc.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct pre_inc; template<> - struct pre_inc { - public: - typedef void is_transparent; + struct pre_inc + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(++std::declval()) diff --git a/sprout/functional/shift_left.hpp b/sprout/functional/shift_left.hpp index deb31b3b..2638f7dc 100644 --- a/sprout/functional/shift_left.hpp +++ b/sprout/functional/shift_left.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct shift_left; template<> - struct shift_left { - public: - typedef void is_transparent; + struct shift_left + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() << std::declval()) diff --git a/sprout/functional/shift_left_assign.hpp b/sprout/functional/shift_left_assign.hpp index c8af3db8..bda3500a 100644 --- a/sprout/functional/shift_left_assign.hpp +++ b/sprout/functional/shift_left_assign.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct shift_left_assign; template<> - struct shift_left_assign { - public: - typedef void is_transparent; + struct shift_left_assign + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() <<= std::declval()) diff --git a/sprout/functional/shift_right.hpp b/sprout/functional/shift_right.hpp index 36a017ec..454f7672 100644 --- a/sprout/functional/shift_right.hpp +++ b/sprout/functional/shift_right.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct shift_right; template<> - struct shift_right { - public: - typedef void is_transparent; + struct shift_right + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() >> std::declval()) diff --git a/sprout/functional/shift_right_assign.hpp b/sprout/functional/shift_right_assign.hpp index 3dd10b06..44c1be80 100644 --- a/sprout/functional/shift_right_assign.hpp +++ b/sprout/functional/shift_right_assign.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct shift_right_assign; template<> - struct shift_right_assign { - public: - typedef void is_transparent; + struct shift_right_assign + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval() >>= std::declval()) diff --git a/sprout/functional/subscript.hpp b/sprout/functional/subscript.hpp index 18cbe0c2..8fb9d2db 100644 --- a/sprout/functional/subscript.hpp +++ b/sprout/functional/subscript.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace sprout { // @@ -19,9 +20,9 @@ namespace sprout { template struct subscript; template<> - struct subscript { - public: - typedef void is_transparent; + struct subscript + : public sprout::transparent<> + { public: template SPROUT_CONSTEXPR decltype(std::declval()[std::declval()]) diff --git a/sprout/valarray/comparison.hpp b/sprout/valarray/comparison.hpp index 21f80f83..e8c3f3f8 100644 --- a/sprout/valarray/comparison.hpp +++ b/sprout/valarray/comparison.hpp @@ -13,7 +13,11 @@ #include #include #include +#include +#include #include +#include +#include #include #include @@ -42,17 +46,17 @@ namespace sprout { template inline SPROUT_CONSTEXPR sprout::valarray operator!=(sprout::valarray const& lhs, sprout::valarray const& rhs) { - return !(lhs == rhs); + return sprout::fixed::transform(lhs.begin(), lhs.end(), rhs.begin(), sprout::valarray(lhs.size()), sprout::not_equal_to<>()); } template inline SPROUT_CONSTEXPR sprout::valarray operator!=(sprout::valarray const& lhs, T const& rhs) { - return !(lhs == rhs); + return sprout::fixed::transform(lhs.begin(), lhs.end(), sprout::valarray(lhs.size()), sprout::bind2nd(sprout::not_equal_to<>(), rhs)); } template inline SPROUT_CONSTEXPR sprout::valarray operator!=(T const& lhs, sprout::valarray const& rhs) { - return !(lhs == rhs); + return sprout::fixed::transform(rhs.begin(), rhs.end(), sprout::valarray(rhs.size()), sprout::bind1st(sprout::not_equal_to<>(), lhs)); } // // operator< @@ -78,17 +82,17 @@ namespace sprout { template inline SPROUT_CONSTEXPR sprout::valarray operator>(sprout::valarray const& lhs, sprout::valarray const& rhs) { - return rhs < lhs; + return sprout::fixed::transform(lhs.begin(), lhs.end(), rhs.begin(), sprout::valarray(lhs.size()), sprout::greater<>()); } template inline SPROUT_CONSTEXPR sprout::valarray operator>(sprout::valarray const& lhs, T const& rhs) { - return rhs < lhs; + return sprout::fixed::transform(lhs.begin(), lhs.end(), sprout::valarray(lhs.size()), sprout::bind2nd(sprout::greater<>(), rhs)); } template inline SPROUT_CONSTEXPR sprout::valarray operator>(T const& lhs, sprout::valarray const& rhs) { - return rhs < lhs; + return sprout::fixed::transform(rhs.begin(), rhs.end(), sprout::valarray(rhs.size()), sprout::bind1st(sprout::greater<>(), lhs)); } // // operator<= @@ -96,17 +100,17 @@ namespace sprout { template inline SPROUT_CONSTEXPR sprout::valarray operator<=(sprout::valarray const& lhs, sprout::valarray const& rhs) { - return !(rhs < lhs); + return sprout::fixed::transform(lhs.begin(), lhs.end(), rhs.begin(), sprout::valarray(lhs.size()), sprout::less_equal<>()); } template inline SPROUT_CONSTEXPR sprout::valarray operator<=(sprout::valarray const& lhs, T const& rhs) { - return !(rhs < lhs); + return sprout::fixed::transform(lhs.begin(), lhs.end(), sprout::valarray(lhs.size()), sprout::bind2nd(sprout::less_equal<>(), rhs)); } template inline SPROUT_CONSTEXPR sprout::valarray operator<=(T const& lhs, sprout::valarray const& rhs) { - return !(rhs < lhs); + return sprout::fixed::transform(rhs.begin(), rhs.end(), sprout::valarray(rhs.size()), sprout::bind1st(sprout::less_equal<>(), lhs)); } // // operator>= @@ -114,17 +118,17 @@ namespace sprout { template inline SPROUT_CONSTEXPR sprout::valarray operator>=(sprout::valarray const& lhs, sprout::valarray const& rhs) { - return !(lhs < rhs); + return sprout::fixed::transform(lhs.begin(), lhs.end(), rhs.begin(), sprout::valarray(lhs.size()), sprout::greater_equal<>()); } template inline SPROUT_CONSTEXPR sprout::valarray operator>=(sprout::valarray const& lhs, T const& rhs) { - return !(lhs < rhs); + return sprout::fixed::transform(lhs.begin(), lhs.end(), sprout::valarray(lhs.size()), sprout::bind2nd(sprout::greater_equal<>(), rhs)); } template inline SPROUT_CONSTEXPR sprout::valarray operator>=(T const& lhs, sprout::valarray const& rhs) { - return !(lhs < rhs); + return sprout::fixed::transform(rhs.begin(), rhs.end(), sprout::valarray(rhs.size()), sprout::bind1st(sprout::greater_equal<>(), lhs)); } } // namespace sprout