Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/spirit/home/phoenix/bind/bind_function.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 /*============================================================================= | |
2 Copyright (c) 2001-2007 Joel de Guzman | |
3 | |
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 ==============================================================================*/ | |
7 #ifndef PHOENIX_BIND_BIND_FUNCTION_HPP | |
8 #define PHOENIX_BIND_BIND_FUNCTION_HPP | |
9 | |
10 #include <boost/spirit/home/phoenix/core/compose.hpp> | |
11 #include <boost/spirit/home/phoenix/core/detail/function_eval.hpp> | |
12 #include <boost/spirit/home/phoenix/bind/detail/function_ptr.hpp> | |
13 | |
14 namespace boost { namespace phoenix | |
15 { | |
16 template <typename RT> | |
17 inline actor< | |
18 typename as_composite< | |
19 detail::function_eval<0> | |
20 , detail::function_ptr<0, RT, RT(*)()> | |
21 >::type> | |
22 bind(RT(*f)()) | |
23 { | |
24 typedef detail::function_ptr<0, RT, RT(*)()> fp_type; | |
25 return compose<detail::function_eval<0> >(fp_type(f)); | |
26 } | |
27 | |
28 template <typename RT, typename T0, typename A0> | |
29 inline actor< | |
30 typename as_composite< | |
31 detail::function_eval<1> | |
32 , detail::function_ptr<1, RT, RT(*)(T0)> | |
33 , A0 | |
34 >::type> | |
35 bind(RT(*f)(T0), A0 const& _0) | |
36 { | |
37 typedef detail::function_ptr<1, RT, RT(*)(T0)> fp_type; | |
38 return compose<detail::function_eval<1> >(fp_type(f), _0); | |
39 } | |
40 | |
41 template <typename RT, typename T0, typename T1, typename A0, typename A1> | |
42 inline actor< | |
43 typename as_composite< | |
44 detail::function_eval<2> | |
45 , detail::function_ptr<2, RT, RT(*)(T0, T1)> | |
46 , A0, A1 | |
47 >::type> | |
48 bind(RT(*f)(T0, T1), A0 const& _0, A1 const& _1) | |
49 { | |
50 typedef detail::function_ptr<2, RT, RT(*)(T0, T1)> fp_type; | |
51 return compose<detail::function_eval<2> >(fp_type(f), _0, _1); | |
52 } | |
53 | |
54 // Bring in the rest of the function binders | |
55 #include <boost/spirit/home/phoenix/bind/detail/bind_function.hpp> | |
56 }} | |
57 | |
58 #endif |