#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_BIND1ST_HPP #define SPROUT_FUNCTIONAL_POLYMORPHIC_BIND1ST_HPP #include #include #include #include namespace sprout { // // binder1st_ // bind1st_ // template class binder1st_ { protected: Fn op; T value; public: SPROUT_CONSTEXPR binder1st_(Fn&& x, T&& y) : op(sprout::forward(x)), value(sprout::forward(y)) {} template SPROUT_CONSTEXPR decltype(op(value, std::declval())) operator()(Arg&& x) const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(op(value, std::declval()))) { return op(value, sprout::forward(x)); } }; template SPROUT_CONSTEXPR sprout::binder1st_::type, typename std::decay::type> bind1st_(Fn&& fn, T&& x) { typedef sprout::binder1st_::type, typename std::decay::type> type; return type(sprout::forward(fn), sprout::forward(x)); } } // namespace sprout #endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_BIND1ST_HPP