diff --git a/sprout/functional/address_of.hpp b/sprout/functional/address_of.hpp new file mode 100644 index 00000000..4225e7b7 --- /dev/null +++ b/sprout/functional/address_of.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_ADDRESS_OF_HPP +#define SPROUT_FUNCTIONAL_ADDRESS_OF_HPP + +#include +#include +#include + +namespace sprout { + // + // address_of + // + template + struct address_of; + template<> + struct address_of { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(&std::declval()) + operator()(T&& x) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(&std::declval())) + { + return &sprout::forward(x); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_ADDRESS_OF_HPP diff --git a/sprout/functional/assign.hpp b/sprout/functional/assign.hpp new file mode 100644 index 00000000..9e7fbecd --- /dev/null +++ b/sprout/functional/assign.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_ASSIGN_HPP +#define SPROUT_FUNCTIONAL_ASSIGN_HPP + +#include +#include +#include + +namespace sprout { + // + // assign + // + template + struct assign; + template<> + struct assign { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() = std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() = std::declval())) + { + return sprout::forward(x) = sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_ASSIGN_HPP diff --git a/sprout/functional/assignment.hpp b/sprout/functional/assignment.hpp new file mode 100644 index 00000000..bfac86de --- /dev/null +++ b/sprout/functional/assignment.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_ASSIGNMENT_HPP +#define SPROUT_FUNCTIONAL_ASSIGNMENT_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // #ifndef SPROUT_FUNCTIONAL_ASSIGNMENT_HPP diff --git a/sprout/functional/bit_and_assign.hpp b/sprout/functional/bit_and_assign.hpp new file mode 100644 index 00000000..e004dfab --- /dev/null +++ b/sprout/functional/bit_and_assign.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_BIT_AND_ASSIGN_HPP +#define SPROUT_FUNCTIONAL_BIT_AND_ASSIGN_HPP + +#include +#include +#include + +namespace sprout { + // + // bit_and_assign + // + template + struct bit_and_assign; + template<> + struct bit_and_assign { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() &= std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() &= std::declval())) + { + return sprout::forward(x) &= sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_BIT_AND_ASSIGN_HPP diff --git a/sprout/functional/bit_or_assign.hpp b/sprout/functional/bit_or_assign.hpp new file mode 100644 index 00000000..6ca6cb53 --- /dev/null +++ b/sprout/functional/bit_or_assign.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_BIT_OR_ASSIGN_HPP +#define SPROUT_FUNCTIONAL_BIT_OR_ASSIGN_HPP + +#include +#include +#include + +namespace sprout { + // + // bit_or_assign + // + template + struct bit_or_assign; + template<> + struct bit_or_assign { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() |= std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() |= std::declval())) + { + return sprout::forward(x) |= sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_BIT_OR_ASSIGN_HPP diff --git a/sprout/functional/bit_xor_assign.hpp b/sprout/functional/bit_xor_assign.hpp new file mode 100644 index 00000000..a9f05c4e --- /dev/null +++ b/sprout/functional/bit_xor_assign.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_BIT_XOR_ASSIGN_HPP +#define SPROUT_FUNCTIONAL_BIT_XOR_ASSIGN_HPP + +#include +#include +#include + +namespace sprout { + // + // bit_xor_assign + // + template + struct bit_xor_assign; + template<> + struct bit_xor_assign { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() ^= std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() ^= std::declval())) + { + return sprout::forward(x) ^= sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_BIT_XOR_ASSIGN_HPP diff --git a/sprout/functional/bitwise.hpp b/sprout/functional/bitwise.hpp index 4af4247a..e8318244 100644 --- a/sprout/functional/bitwise.hpp +++ b/sprout/functional/bitwise.hpp @@ -13,5 +13,7 @@ #include #include #include +#include +#include #endif // #ifndef SPROUT_FUNCTIONAL_BITWISE_HPP diff --git a/sprout/functional/call_fun.hpp b/sprout/functional/call_fun.hpp new file mode 100644 index 00000000..6e60b44a --- /dev/null +++ b/sprout/functional/call_fun.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_CALL_FUN_HPP +#define SPROUT_FUNCTIONAL_CALL_FUN_HPP + +#include +#include +#include + +namespace sprout { + // + // call_fun + // + template + struct call_fun; + template<> + struct call_fun { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval()(std::declval()...)) + operator()(F&& f, As&&... as) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval()(std::declval()...))) + { + return sprout::forward(f)(sprout::forward(as)...); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_CALL_FUN_HPP diff --git a/sprout/functional/comma.hpp b/sprout/functional/comma.hpp new file mode 100644 index 00000000..68ff803b --- /dev/null +++ b/sprout/functional/comma.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_COMMA_HPP +#define SPROUT_FUNCTIONAL_COMMA_HPP + +#include +#include +#include + +namespace sprout { + // + // comma + // + template + struct comma; + template<> + struct comma { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval(), std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR((std::declval(), std::declval()))) + { + return sprout::forward(x), sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_COMMA_HPP diff --git a/sprout/functional/cond.hpp b/sprout/functional/cond.hpp new file mode 100644 index 00000000..b660312b --- /dev/null +++ b/sprout/functional/cond.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_COND_HPP +#define SPROUT_FUNCTIONAL_COND_HPP + +#include +#include +#include + +namespace sprout { + // + // cond + // + template + struct cond; + template<> + struct cond { + public: + typedef void is_transparent; + public: + 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())) + { + return sprout::forward(x) ? sprout::forward(y) : sprout::forward(z); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_COND_HPP diff --git a/sprout/functional/dereference.hpp b/sprout/functional/dereference.hpp new file mode 100644 index 00000000..caa91e77 --- /dev/null +++ b/sprout/functional/dereference.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_DEREFERENCE_HPP +#define SPROUT_FUNCTIONAL_DEREFERENCE_HPP + +#include +#include +#include + +namespace sprout { + // + // dereference + // + template + struct dereference; + template<> + struct dereference { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(*std::declval()) + operator()(T&& x) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(*std::declval())) + { + return *sprout::forward(x); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_DEREFERENCE_HPP diff --git a/sprout/functional/divides_assign.hpp b/sprout/functional/divides_assign.hpp new file mode 100644 index 00000000..5a3a1208 --- /dev/null +++ b/sprout/functional/divides_assign.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_DEVIDES_ASSIGN_HPP +#define SPROUT_FUNCTIONAL_DEVIDES_ASSIGN_HPP + +#include +#include +#include + +namespace sprout { + // + // divides_assign + // + template + struct divides_assign; + template<> + struct divides_assign { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() /= std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() /= std::declval())) + { + return sprout::forward(x) /= sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_DEVIDES_ASSIGN_HPP diff --git a/sprout/functional/functor.hpp b/sprout/functional/functor.hpp index 249adaeb..107c0ee9 100644 --- a/sprout/functional/functor.hpp +++ b/sprout/functional/functor.hpp @@ -13,6 +13,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include diff --git a/sprout/functional/inc_dec.hpp b/sprout/functional/inc_dec.hpp new file mode 100644 index 00000000..329ac2b1 --- /dev/null +++ b/sprout/functional/inc_dec.hpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_INC_DEC_HPP +#define SPROUT_FUNCTIONAL_INC_DEC_HPP + +#include +#include +#include +#include +#include + +#endif // #ifndef SPROUT_FUNCTIONAL_INC_DEC_HPP diff --git a/sprout/functional/mem_ptr.hpp b/sprout/functional/mem_ptr.hpp new file mode 100644 index 00000000..cbf9ab45 --- /dev/null +++ b/sprout/functional/mem_ptr.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_MEM_PTR_HPP +#define SPROUT_FUNCTIONAL_MEM_PTR_HPP + +#include +#include +#include + +namespace sprout { + // + // mem_ptr + // + template + struct mem_ptr; + template<> + struct mem_ptr { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval()->*std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval()->*std::declval())) + { + return sprout::forward(x)->*sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_MEM_PTR_HPP diff --git a/sprout/functional/member.hpp b/sprout/functional/member.hpp new file mode 100644 index 00000000..1a5312d6 --- /dev/null +++ b/sprout/functional/member.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_MEMBER_HPP +#define SPROUT_FUNCTIONAL_MEMBER_HPP + +#include +#include +#include + +namespace sprout { + // + // member + // + template + struct member; + template<> + struct member { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval().*std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval().*std::declval())) + { + return sprout::forward(x).*sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_MEMBER_HPP diff --git a/sprout/functional/members.hpp b/sprout/functional/members.hpp new file mode 100644 index 00000000..7c385a0e --- /dev/null +++ b/sprout/functional/members.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_MEMBERS_HPP +#define SPROUT_FUNCTIONAL_MEMBERS_HPP + +#include +#include +#include + +#endif // #ifndef SPROUT_FUNCTIONAL_MEMBERS_HPP diff --git a/sprout/functional/minus_assign.hpp b/sprout/functional/minus_assign.hpp new file mode 100644 index 00000000..8abe76ec --- /dev/null +++ b/sprout/functional/minus_assign.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_MINUS_ASSIGN_HPP +#define SPROUT_FUNCTIONAL_MINUS_ASSIGN_HPP + +#include +#include +#include + +namespace sprout { + // + // minus_assign + // + template + struct minus_assign; + template<> + struct minus_assign { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() -= std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() -= std::declval())) + { + return sprout::forward(x) -= sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_MINUS_ASSIGN_HPP diff --git a/sprout/functional/modulus_assign.hpp b/sprout/functional/modulus_assign.hpp new file mode 100644 index 00000000..ff927ab7 --- /dev/null +++ b/sprout/functional/modulus_assign.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_MODULUS_ASSIGN_HPP +#define SPROUT_FUNCTIONAL_MODULUS_ASSIGN_HPP + +#include +#include +#include + +namespace sprout { + // + // modulus_assign + // + template + struct modulus_assign; + template<> + struct modulus_assign { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() %= std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() %= std::declval())) + { + return sprout::forward(x) %= sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_MODULUS_ASSIGN_HPP diff --git a/sprout/functional/multiplies_assign.hpp b/sprout/functional/multiplies_assign.hpp new file mode 100644 index 00000000..dd96fd5e --- /dev/null +++ b/sprout/functional/multiplies_assign.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_MULTIPLIES_ASSIGN_HPP +#define SPROUT_FUNCTIONAL_MULTIPLIES_ASSIGN_HPP + +#include +#include +#include + +namespace sprout { + // + // multiplies_assign + // + template + struct multiplies_assign; + template<> + struct multiplies_assign { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() *= std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() *= std::declval())) + { + return sprout::forward(x) *= sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_MULTIPLIES_ASSIGN_HPP diff --git a/sprout/functional/plus_assign.hpp b/sprout/functional/plus_assign.hpp new file mode 100644 index 00000000..543f5c12 --- /dev/null +++ b/sprout/functional/plus_assign.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_PLUS_ASSIGN_HPP +#define SPROUT_FUNCTIONAL_PLUS_ASSIGN_HPP + +#include +#include +#include + +namespace sprout { + // + // plus_assign + // + template + struct plus_assign; + template<> + struct plus_assign { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() += std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() += std::declval())) + { + return sprout::forward(x) += sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_PLUS_ASSIGN_HPP diff --git a/sprout/functional/polymorphic/address_of.hpp b/sprout/functional/polymorphic/address_of.hpp index 4201392d..898516b2 100644 --- a/sprout/functional/polymorphic/address_of.hpp +++ b/sprout/functional/polymorphic/address_of.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_ADDRESS_OF_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_ADDRESS_OF_HPP -#include #include -#include +#include namespace sprout { // // address_of_t // address_of_ // - struct address_of_t { - public: - template - SPROUT_CONSTEXPR decltype(&std::declval()) - operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(&std::declval())) - { - return &sprout::forward(x); - } - }; + typedef sprout::address_of<> address_of_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::address_of_t address_of_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/assign.hpp b/sprout/functional/polymorphic/assign.hpp index 430197d1..1c59282e 100644 --- a/sprout/functional/polymorphic/assign.hpp +++ b/sprout/functional/polymorphic/assign.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_ASSIGN_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_ASSIGN_HPP -#include #include -#include +#include namespace sprout { // // assign_t // assign_ // - struct assign_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() = std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() = std::declval())) - { - return sprout::forward(x) = sprout::forward(y); - } - }; + typedef sprout::assign<> assign_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::assign_t assign_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/assignment.hpp b/sprout/functional/polymorphic/assignment.hpp index 86e3c83e..7711d84a 100644 --- a/sprout/functional/polymorphic/assignment.hpp +++ b/sprout/functional/polymorphic/assignment.hpp @@ -9,6 +9,7 @@ #define SPROUT_FUNCTIONAL_POLYMORPHIC_ASSIGNMENT_HPP #include +#include #include #include #include diff --git a/sprout/functional/polymorphic/bit_and_assign.hpp b/sprout/functional/polymorphic/bit_and_assign.hpp index 8dfef6e3..15be5270 100644 --- a/sprout/functional/polymorphic/bit_and_assign.hpp +++ b/sprout/functional/polymorphic/bit_and_assign.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_BIT_AND_ASSIGN_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_BIT_AND_ASSIGN_HPP -#include #include -#include +#include namespace sprout { // // bit_and_assign_t // bit_and_assign_ // - struct bit_and_assign_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() &= std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() &= std::declval())) - { - return sprout::forward(x) &= sprout::forward(y); - } - }; + typedef sprout::bit_and_assign<> bit_and_assign_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::bit_and_assign_t bit_and_assign_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/bit_or_assign.hpp b/sprout/functional/polymorphic/bit_or_assign.hpp index 470b2404..0b31c436 100644 --- a/sprout/functional/polymorphic/bit_or_assign.hpp +++ b/sprout/functional/polymorphic/bit_or_assign.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_BIT_OR_ASSIGN_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_BIT_OR_ASSIGN_HPP -#include #include -#include +#include namespace sprout { // // bit_or_assign_t // bit_or_assign_ // - struct bit_or_assign_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() |= std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() |= std::declval())) - { - return sprout::forward(x) |= sprout::forward(y); - } - }; + typedef sprout::bit_or_assign<> bit_or_assign_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::bit_or_assign_t bit_or_assign_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/bit_xor_assign.hpp b/sprout/functional/polymorphic/bit_xor_assign.hpp index 10390887..f3ab2423 100644 --- a/sprout/functional/polymorphic/bit_xor_assign.hpp +++ b/sprout/functional/polymorphic/bit_xor_assign.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_BIT_XOR_ASSIGN_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_BIT_XOR_ASSIGN_HPP -#include #include -#include +#include namespace sprout { // // bit_xor_assign_t // bit_xor_assign_ // - struct bit_xor_assign_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() ^= std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() ^= std::declval())) - { - return sprout::forward(x) ^= sprout::forward(y); - } - }; + typedef sprout::bit_xor_assign<> bit_xor_assign_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::bit_xor_assign_t bit_xor_assign_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/call_fun.hpp b/sprout/functional/polymorphic/call_fun.hpp index 08695a2e..2affe616 100644 --- a/sprout/functional/polymorphic/call_fun.hpp +++ b/sprout/functional/polymorphic/call_fun.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_CALL_FUN_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_CALL_FUN_HPP -#include #include -#include +#include namespace sprout { // // call_fun_t // call_fun_ // - struct call_fun_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval()(std::declval()...)) - operator()(F&& f, As&&... as) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval()(std::declval()...))) - { - return sprout::forward(f)(sprout::forward(as)...); - } - }; + typedef sprout::call_fun<> call_fun_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::call_fun_t call_fun_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/comma.hpp b/sprout/functional/polymorphic/comma.hpp index 9b2fe232..3d949bc6 100644 --- a/sprout/functional/polymorphic/comma.hpp +++ b/sprout/functional/polymorphic/comma.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_COMMA_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_COMMA_HPP -#include #include -#include +#include namespace sprout { // // comma_t // comma_ // - struct comma_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval(), std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR((std::declval(), std::declval()))) - { - return sprout::forward(x), sprout::forward(y); - } - }; + typedef sprout::comma<> comma_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::comma_t comma_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/cond.hpp b/sprout/functional/polymorphic/cond.hpp index d45aaaa5..fceed3cf 100644 --- a/sprout/functional/polymorphic/cond.hpp +++ b/sprout/functional/polymorphic/cond.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_COND_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_COND_HPP -#include #include -#include +#include namespace sprout { // // cond_t // cond_ // - struct cond_t { - public: - 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())) - { - return sprout::forward(x) ? sprout::forward(y) : sprout::forward(z); - } - }; + typedef sprout::cond<> cond_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::cond_t cond_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/dereference.hpp b/sprout/functional/polymorphic/dereference.hpp index aacb9e83..395d2be9 100644 --- a/sprout/functional/polymorphic/dereference.hpp +++ b/sprout/functional/polymorphic/dereference.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_DEREFERENCE_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_DEREFERENCE_HPP -#include #include -#include +#include namespace sprout { // // dereference_t // dereference_ // - struct dereference_t { - public: - template - SPROUT_CONSTEXPR decltype(*std::declval()) - operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(*std::declval())) - { - return *sprout::forward(x); - } - }; + typedef sprout::dereference<> dereference_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::dereference_t dereference_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/divides_assign.hpp b/sprout/functional/polymorphic/divides_assign.hpp index 915cb8dc..d482cab2 100644 --- a/sprout/functional/polymorphic/divides_assign.hpp +++ b/sprout/functional/polymorphic/divides_assign.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_DEVIDES_ASSIGN_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_DEVIDES_ASSIGN_HPP -#include #include -#include +#include namespace sprout { // // divides_assign_t // divides_assign_ // - struct divides_assign_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() /= std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() /= std::declval())) - { - return sprout::forward(x) /= sprout::forward(y); - } - }; + typedef sprout::divides_assign<> divides_assign_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::divides_assign_t divides_assign_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/mem_ptr.hpp b/sprout/functional/polymorphic/mem_ptr.hpp index 83d25c29..007d2ccb 100644 --- a/sprout/functional/polymorphic/mem_ptr.hpp +++ b/sprout/functional/polymorphic/mem_ptr.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MEM_PTR_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_MEM_PTR_HPP -#include #include -#include +#include namespace sprout { // // mem_ptr_t // mem_ptr_ // - struct mem_ptr_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval()->*std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval()->*std::declval())) - { - return sprout::forward(x)->*sprout::forward(y); - } - }; + typedef sprout::mem_ptr<> mem_ptr_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::mem_ptr_t mem_ptr_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/member.hpp b/sprout/functional/polymorphic/member.hpp index a5850cac..f91abc17 100644 --- a/sprout/functional/polymorphic/member.hpp +++ b/sprout/functional/polymorphic/member.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MEMBER_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_MEMBER_HPP -#include #include -#include +#include namespace sprout { // // member_t // member_ // - struct member_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval().*std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval().*std::declval())) - { - return sprout::forward(x).*sprout::forward(y); - } - }; + typedef sprout::member<> member_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::member_t member_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/minus_assign.hpp b/sprout/functional/polymorphic/minus_assign.hpp index 33c1db76..3c55b596 100644 --- a/sprout/functional/polymorphic/minus_assign.hpp +++ b/sprout/functional/polymorphic/minus_assign.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MINUS_ASSIGN_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_MINUS_ASSIGN_HPP -#include #include -#include +#include namespace sprout { // // minus_assign_t // minus_assign_ // - struct minus_assign_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() -= std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() -= std::declval())) - { - return sprout::forward(x) -= sprout::forward(y); - } - }; + typedef sprout::minus_assign<> minus_assign_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::minus_assign_t minus_assign_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/modulus_assign.hpp b/sprout/functional/polymorphic/modulus_assign.hpp index deab84cf..2b35f558 100644 --- a/sprout/functional/polymorphic/modulus_assign.hpp +++ b/sprout/functional/polymorphic/modulus_assign.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MODULUS_ASSIGN_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_MODULUS_ASSIGN_HPP -#include #include -#include +#include namespace sprout { // // modulus_assign_t // modulus_assign_ // - struct modulus_assign_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() %= std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() %= std::declval())) - { - return sprout::forward(x) %= sprout::forward(y); - } - }; + typedef sprout::modulus_assign<> modulus_assign_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::modulus_assign_t modulus_assign_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/multiplies_assign.hpp b/sprout/functional/polymorphic/multiplies_assign.hpp index ba647ab1..12ba3ff8 100644 --- a/sprout/functional/polymorphic/multiplies_assign.hpp +++ b/sprout/functional/polymorphic/multiplies_assign.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MULTIPLIES_ASSIGN_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_MULTIPLIES_ASSIGN_HPP -#include #include -#include +#include namespace sprout { // // multiplies_assign_t // multiplies_assign_ // - struct multiplies_assign_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() *= std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() *= std::declval())) - { - return sprout::forward(x) *= sprout::forward(y); - } - }; + typedef sprout::multiplies_assign<> multiplies_assign_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::multiplies_assign_t multiplies_assign_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/plus_assign.hpp b/sprout/functional/polymorphic/plus_assign.hpp index 858a7dc5..867d661b 100644 --- a/sprout/functional/polymorphic/plus_assign.hpp +++ b/sprout/functional/polymorphic/plus_assign.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_PLUS_ASSIGN_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_PLUS_ASSIGN_HPP -#include #include -#include +#include namespace sprout { // // plus_assign_t // plus_assign_ // - struct plus_assign_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() += std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() += std::declval())) - { - return sprout::forward(x) += sprout::forward(y); - } - }; + typedef sprout::plus_assign<> plus_assign_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::plus_assign_t plus_assign_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/post_dec.hpp b/sprout/functional/polymorphic/post_dec.hpp index d9a17f30..e8d25c12 100644 --- a/sprout/functional/polymorphic/post_dec.hpp +++ b/sprout/functional/polymorphic/post_dec.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_POST_DEC_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_POST_DEC_HPP -#include #include -#include +#include namespace sprout { // // post_dec_t // post_dec_ // - struct post_dec_t { - public: - template - SPROUT_CONSTEXPR decltype(~std::declval()--) - operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(~std::declval()--)) - { - return sprout::forward(x)--; - } - }; + typedef sprout::post_dec<> post_dec_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::post_dec_t post_dec_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/post_inc.hpp b/sprout/functional/polymorphic/post_inc.hpp index e2df036e..8278f412 100644 --- a/sprout/functional/polymorphic/post_inc.hpp +++ b/sprout/functional/polymorphic/post_inc.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_POST_INC_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_POST_INC_HPP -#include #include -#include +#include namespace sprout { // // post_inc_t // post_inc_ // - struct post_inc_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval()++) - operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval()++)) - { - return sprout::forward(x)++; - } - }; + typedef sprout::post_inc<> post_inc_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::post_inc_t post_inc_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/pre_dec.hpp b/sprout/functional/polymorphic/pre_dec.hpp index 147a2c58..c2138e17 100644 --- a/sprout/functional/polymorphic/pre_dec.hpp +++ b/sprout/functional/polymorphic/pre_dec.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_DEC_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_DEC_HPP -#include #include -#include +#include namespace sprout { // // pre_dec_t // pre_dec_ // - struct pre_dec_t { - public: - template - SPROUT_CONSTEXPR decltype(--std::declval()) - operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(--std::declval())) - { - return --sprout::forward(x); - } - }; + typedef sprout::pre_dec<> pre_dec_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::pre_dec_t pre_dec_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/pre_inc.hpp b/sprout/functional/polymorphic/pre_inc.hpp index 15b098c4..34a0a0fd 100644 --- a/sprout/functional/polymorphic/pre_inc.hpp +++ b/sprout/functional/polymorphic/pre_inc.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_INC_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_INC_HPP -#include #include -#include +#include namespace sprout { // // pre_inc_t // pre_inc_ // - struct pre_inc_t { - public: - template - SPROUT_CONSTEXPR decltype(++std::declval()) - operator()(T&& x) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(++std::declval())) - { - return ++sprout::forward(x); - } - }; + typedef sprout::pre_inc<> pre_inc_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::pre_inc_t pre_inc_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/shift_left.hpp b/sprout/functional/polymorphic/shift_left.hpp index 9d7457cf..46636966 100644 --- a/sprout/functional/polymorphic/shift_left.hpp +++ b/sprout/functional/polymorphic/shift_left.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_HPP -#include #include -#include +#include namespace sprout { // // shift_left_t // shift_left_ // - struct shift_left_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() << std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() << std::declval())) - { - return sprout::forward(x) << sprout::forward(y); - } - }; + typedef sprout::shift_left<> shift_left_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::shift_left_t shift_left_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/shift_left_assign.hpp b/sprout/functional/polymorphic/shift_left_assign.hpp index 430ee009..dcf977fc 100644 --- a/sprout/functional/polymorphic/shift_left_assign.hpp +++ b/sprout/functional/polymorphic/shift_left_assign.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_ASSIGN_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_ASSIGN_HPP -#include #include -#include +#include namespace sprout { // // shift_left_assign_t // shift_left_assign_ // - struct shift_left_assign_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() <<= std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() <<= std::declval())) - { - return sprout::forward(x) <<= sprout::forward(y); - } - }; + typedef sprout::shift_left_assign<> shift_left_assign_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::shift_left_assign_t shift_left_assign_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/shift_right.hpp b/sprout/functional/polymorphic/shift_right.hpp index f2f627f4..f1a7ce61 100644 --- a/sprout/functional/polymorphic/shift_right.hpp +++ b/sprout/functional/polymorphic/shift_right.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_HPP -#include #include -#include +#include namespace sprout { // // shift_right_t // shift_right_ // - struct shift_right_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() >> std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() >> std::declval())) - { - return sprout::forward(x) >> sprout::forward(y); - } - }; + typedef sprout::shift_right<> shift_right_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::shift_right_t shift_right_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/shift_right_assign.hpp b/sprout/functional/polymorphic/shift_right_assign.hpp index 5dea5441..21d0d114 100644 --- a/sprout/functional/polymorphic/shift_right_assign.hpp +++ b/sprout/functional/polymorphic/shift_right_assign.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_ASSIGN_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_ASSIGN_HPP -#include #include -#include +#include namespace sprout { // // shift_right_assign_t // shift_right_assign_ // - struct shift_right_assign_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval() >>= std::declval()) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() >>= std::declval())) - { - return sprout::forward(x) >>= sprout::forward(y); - } - }; + typedef sprout::shift_right_assign<> shift_right_assign_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::shift_right_assign_t shift_right_assign_ = {}; } // anonymous-namespace diff --git a/sprout/functional/polymorphic/subscript.hpp b/sprout/functional/polymorphic/subscript.hpp index eea6c7d0..d9a6c5c9 100644 --- a/sprout/functional/polymorphic/subscript.hpp +++ b/sprout/functional/polymorphic/subscript.hpp @@ -8,25 +8,15 @@ #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_SUBSCRIPT_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_SUBSCRIPT_HPP -#include #include -#include +#include namespace sprout { // // subscript_t // subscript_ // - struct subscript_t { - public: - template - SPROUT_CONSTEXPR decltype(std::declval()[std::declval()]) - operator()(T&& x, U&& y) - const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval()[std::declval()])) - { - return sprout::forward(x)[sprout::forward(y)]; - } - }; + typedef sprout::subscript<> subscript_t; namespace { SPROUT_STATIC_CONSTEXPR sprout::subscript_t subscript_ = {}; } // anonymous-namespace diff --git a/sprout/functional/post_dec.hpp b/sprout/functional/post_dec.hpp new file mode 100644 index 00000000..303b9929 --- /dev/null +++ b/sprout/functional/post_dec.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_POST_DEC_HPP +#define SPROUT_FUNCTIONAL_POST_DEC_HPP + +#include +#include +#include + +namespace sprout { + // + // post_dec + // + template + struct post_dec; + template<> + struct post_dec { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(~std::declval()--) + operator()(T&& x) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(~std::declval()--)) + { + return sprout::forward(x)--; + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_POST_DEC_HPP diff --git a/sprout/functional/post_inc.hpp b/sprout/functional/post_inc.hpp new file mode 100644 index 00000000..476657c6 --- /dev/null +++ b/sprout/functional/post_inc.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_POST_INC_HPP +#define SPROUT_FUNCTIONAL_POST_INC_HPP + +#include +#include +#include + +namespace sprout { + // + // post_inc + // + template + struct post_inc; + template<> + struct post_inc { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval()++) + operator()(T&& x) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval()++)) + { + return sprout::forward(x)++; + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_POST_INC_HPP diff --git a/sprout/functional/pre_dec.hpp b/sprout/functional/pre_dec.hpp new file mode 100644 index 00000000..c18d94f0 --- /dev/null +++ b/sprout/functional/pre_dec.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_PRE_DEC_HPP +#define SPROUT_FUNCTIONAL_PRE_DEC_HPP + +#include +#include +#include + +namespace sprout { + // + // pre_dec + // + template + struct pre_dec; + template<> + struct pre_dec { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(--std::declval()) + operator()(T&& x) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(--std::declval())) + { + return --sprout::forward(x); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_PRE_DEC_HPP diff --git a/sprout/functional/pre_inc.hpp b/sprout/functional/pre_inc.hpp new file mode 100644 index 00000000..74d3e016 --- /dev/null +++ b/sprout/functional/pre_inc.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_PRE_INC_HPP +#define SPROUT_FUNCTIONAL_PRE_INC_HPP + +#include +#include +#include + +namespace sprout { + // + // pre_inc + // + template + struct pre_inc; + template<> + struct pre_inc { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(++std::declval()) + operator()(T&& x) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(++std::declval())) + { + return ++sprout::forward(x); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_PRE_INC_HPP diff --git a/sprout/functional/reference.hpp b/sprout/functional/reference.hpp new file mode 100644 index 00000000..bdf65a04 --- /dev/null +++ b/sprout/functional/reference.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_REFERENCE_HPP +#define SPROUT_FUNCTIONAL_REFERENCE_HPP + +#include +#include +#include + +#endif // #ifndef SPROUT_FUNCTIONAL_REFERENCE_HPP diff --git a/sprout/functional/shift_left.hpp b/sprout/functional/shift_left.hpp new file mode 100644 index 00000000..d4b339b6 --- /dev/null +++ b/sprout/functional/shift_left.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_SHIFT_LEFT_HPP +#define SPROUT_FUNCTIONAL_SHIFT_LEFT_HPP + +#include +#include +#include + +namespace sprout { + // + // shift_left + // + template + struct shift_left; + template<> + struct shift_left { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() << std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() << std::declval())) + { + return sprout::forward(x) << sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_SHIFT_LEFT_HPP diff --git a/sprout/functional/shift_left_assign.hpp b/sprout/functional/shift_left_assign.hpp new file mode 100644 index 00000000..9ea3cba1 --- /dev/null +++ b/sprout/functional/shift_left_assign.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_SHIFT_LEFT_ASSIGN_HPP +#define SPROUT_FUNCTIONAL_SHIFT_LEFT_ASSIGN_HPP + +#include +#include +#include + +namespace sprout { + // + // shift_left_assign + // + template + struct shift_left_assign; + template<> + struct shift_left_assign { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() <<= std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() <<= std::declval())) + { + return sprout::forward(x) <<= sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_SHIFT_LEFT_ASSIGN_HPP diff --git a/sprout/functional/shift_right.hpp b/sprout/functional/shift_right.hpp new file mode 100644 index 00000000..d590e83c --- /dev/null +++ b/sprout/functional/shift_right.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_SHIFT_RIGHT_HPP +#define SPROUT_FUNCTIONAL_SHIFT_RIGHT_HPP + +#include +#include +#include + +namespace sprout { + // + // shift_right + // + template + struct shift_right; + template<> + struct shift_right { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() >> std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() << std::declval())) + { + return sprout::forward(x) >> sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_SHIFT_RIGHT_HPP diff --git a/sprout/functional/shift_right_assign.hpp b/sprout/functional/shift_right_assign.hpp new file mode 100644 index 00000000..5fb61603 --- /dev/null +++ b/sprout/functional/shift_right_assign.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_SHIFT_LEFT_ASSIGN_HPP +#define SPROUT_FUNCTIONAL_SHIFT_LEFT_ASSIGN_HPP + +#include +#include +#include + +namespace sprout { + // + // shift_right_assign + // + template + struct shift_right_assign; + template<> + struct shift_right_assign { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval() >>= std::declval()) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval() >>= std::declval())) + { + return sprout::forward(x) >>= sprout::forward(y); + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_SHIFT_LEFT_ASSIGN_HPP diff --git a/sprout/functional/subscript.hpp b/sprout/functional/subscript.hpp new file mode 100644 index 00000000..c3dafdec --- /dev/null +++ b/sprout/functional/subscript.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_SUBSCRIPT_HPP +#define SPROUT_FUNCTIONAL_SUBSCRIPT_HPP + +#include +#include +#include + +namespace sprout { + // + // subscript + // + template + struct subscript; + template<> + struct subscript { + public: + typedef void is_transparent; + public: + template + SPROUT_CONSTEXPR decltype(std::declval()[std::declval()]) + operator()(T&& x, U&& y) + const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval()[std::declval()])) + { + return sprout::forward(x)[sprout::forward(y)]; + } + }; +} // namespace sprout + +#endif // #ifndef SPROUT_FUNCTIONAL_SUBSCRIPT_HPP diff --git a/sprout/functional/type_traits/is_transparent_function.hpp b/sprout/functional/type_traits/is_transparent_function.hpp index e71d330a..29d8303f 100644 --- a/sprout/functional/type_traits/is_transparent_function.hpp +++ b/sprout/functional/type_traits/is_transparent_function.hpp @@ -13,7 +13,7 @@ namespace sprout { // - // is_transparent + // is_transparent_function // SPROUT_HAS_XXX_TYPE_DEF(is_transparent_function, is_transparent); } // namespace sprout diff --git a/sprout/functional/various.hpp b/sprout/functional/various.hpp new file mode 100644 index 00000000..4c5e375a --- /dev/null +++ b/sprout/functional/various.hpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2011-2013 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_FUNCTIONAL_VARIOUS_HPP +#define SPROUT_FUNCTIONAL_VARIOUS_HPP + +#include +#include +#include +#include +#include + +#endif // #ifndef SPROUT_FUNCTIONAL_VARIOUS_HPP