Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/phoenix/function/adapt_callable.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children | c530137014c0 |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 /*============================================================================== | |
2 Copyright (c) 2005-2010 Joel de Guzman | |
3 Copyright (c) 2011 Thomas Heller | |
4 | |
5 Distributed under the Boost Software License, Version 1.0. (See accompanying | |
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
7 ==============================================================================*/ | |
8 #ifndef BOOST_PHOENIX_FUNCTION_ADAPT_CALLABLE_HPP | |
9 #define BOOST_PHOENIX_FUNCTION_ADAPT_CALLABLE_HPP | |
10 | |
11 #include <boost/phoenix/core/limits.hpp> | |
12 #include <boost/phoenix/core/detail/function_eval.hpp> | |
13 #include <boost/preprocessor/repetition/repeat.hpp> | |
14 | |
15 #define BOOST_PHOENIX_ADAPT_CALLABLE_NULLARY(NAME, FUNC) \ | |
16 boost::phoenix::detail::expression::function_eval<FUNC>::type const \ | |
17 inline NAME() \ | |
18 { \ | |
19 return boost::phoenix::detail::expression:: \ | |
20 function_eval<FUNC>::make(FUNC()); \ | |
21 } \ | |
22 /**/ | |
23 | |
24 | |
25 #define BOOST_PHOENIX_ADAPT_CALLABLE(NAME, FUNC, N) \ | |
26 template <BOOST_PHOENIX_typename_A(N)> \ | |
27 typename \ | |
28 boost::phoenix::detail::expression::function_eval< \ | |
29 FUNC \ | |
30 , BOOST_PHOENIX_A(N)>::type const \ | |
31 inline NAME(BOOST_PHOENIX_A_const_ref_a(N)) \ | |
32 { \ | |
33 return boost::phoenix::detail::expression:: \ | |
34 function_eval<FUNC, BOOST_PHOENIX_A(N)>:: \ | |
35 make(FUNC(), BOOST_PHOENIX_a(N)); \ | |
36 } \ | |
37 /**/ | |
38 | |
39 | |
40 #define BOOST_PHOENIX_ADAPT_CALLABLE_VARARG(NAME, FUNC) \ | |
41 BOOST_PHOENIX_ADAPT_CALLABLE_NULLARY(NAME, FUNC) \ | |
42 BOOST_PP_REPEAT_FROM_TO( \ | |
43 1 \ | |
44 , BOOST_PHOENIX_LIMIT \ | |
45 , BOOST_PHOENIX_ADAPT_CALLABLE_VARARG_R \ | |
46 , (NAME, FUNC) \ | |
47 ) \ | |
48 /**/ | |
49 | |
50 #define BOOST_PHOENIX_ADAPT_CALLABLE_VARARG_R(Z, N, D) \ | |
51 BOOST_PHOENIX_ADAPT_CALLABLE( \ | |
52 BOOST_PP_TUPLE_ELEM(2, 0, D) \ | |
53 , BOOST_PP_TUPLE_ELEM(2, 1, D) \ | |
54 , N \ | |
55 ) \ | |
56 /**/ | |
57 | |
58 #endif |