1 /*=============================================================================
2 Copyright (c) 2016 Kohei Takahashi
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
8 #ifndef PHOENIX_BIND_BIND_FUNCTION_HPP
9 #define PHOENIX_BIND_BIND_FUNCTION_HPP
11 #include <boost/phoenix/core/limits.hpp>
13 #if defined(BOOST_PHOENIX_NO_VARIADIC_BIND)
14 # include <boost/phoenix/bind/detail/cpp03/bind_function.hpp>
17 #include <boost/phoenix/core/expression.hpp>
18 #include <boost/phoenix/core/detail/function_eval.hpp>
20 namespace boost { namespace phoenix
24 template <typename RT, typename FP>
27 typedef RT result_type;
32 template <typename... A>
33 result_type operator()(A&... a) const
38 bool operator==(function_ptr const& rhs) const
43 template <typename RhsRT, typename RhsFP>
44 bool operator==(function_ptr<RhsRT, RhsFP> const& /*rhs*/) const
51 } // namespace boost::phoenix::detail
53 template <typename RT, typename... T, typename... A>
54 inline typename detail::expression::function_eval<
55 detail::function_ptr<RT, RT (*)(T...)>
58 bind(RT (*f)(T...), A const&... a)
60 typedef detail::function_ptr<RT, RT (*)(T...)> fp_type;
61 return detail::expression::function_eval<fp_type, A...>::make(fp_type(f), a...);
63 }} // namespace boost::phoenix