annotate 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
rev   line source
Chris@16 1 /*==============================================================================
Chris@16 2 Copyright (c) 2005-2010 Joel de Guzman
Chris@16 3 Copyright (c) 2011 Thomas Heller
Chris@16 4
Chris@16 5 Distributed under the Boost Software License, Version 1.0. (See accompanying
Chris@16 6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 7 ==============================================================================*/
Chris@16 8 #ifndef BOOST_PHOENIX_FUNCTION_ADAPT_CALLABLE_HPP
Chris@16 9 #define BOOST_PHOENIX_FUNCTION_ADAPT_CALLABLE_HPP
Chris@16 10
Chris@16 11 #include <boost/phoenix/core/limits.hpp>
Chris@16 12 #include <boost/phoenix/core/detail/function_eval.hpp>
Chris@16 13 #include <boost/preprocessor/repetition/repeat.hpp>
Chris@16 14
Chris@16 15 #define BOOST_PHOENIX_ADAPT_CALLABLE_NULLARY(NAME, FUNC) \
Chris@16 16 boost::phoenix::detail::expression::function_eval<FUNC>::type const \
Chris@16 17 inline NAME() \
Chris@16 18 { \
Chris@16 19 return boost::phoenix::detail::expression:: \
Chris@16 20 function_eval<FUNC>::make(FUNC()); \
Chris@16 21 } \
Chris@16 22 /**/
Chris@16 23
Chris@16 24
Chris@16 25 #define BOOST_PHOENIX_ADAPT_CALLABLE(NAME, FUNC, N) \
Chris@16 26 template <BOOST_PHOENIX_typename_A(N)> \
Chris@16 27 typename \
Chris@16 28 boost::phoenix::detail::expression::function_eval< \
Chris@16 29 FUNC \
Chris@16 30 , BOOST_PHOENIX_A(N)>::type const \
Chris@16 31 inline NAME(BOOST_PHOENIX_A_const_ref_a(N)) \
Chris@16 32 { \
Chris@16 33 return boost::phoenix::detail::expression:: \
Chris@16 34 function_eval<FUNC, BOOST_PHOENIX_A(N)>:: \
Chris@16 35 make(FUNC(), BOOST_PHOENIX_a(N)); \
Chris@16 36 } \
Chris@16 37 /**/
Chris@16 38
Chris@16 39
Chris@16 40 #define BOOST_PHOENIX_ADAPT_CALLABLE_VARARG(NAME, FUNC) \
Chris@16 41 BOOST_PHOENIX_ADAPT_CALLABLE_NULLARY(NAME, FUNC) \
Chris@16 42 BOOST_PP_REPEAT_FROM_TO( \
Chris@16 43 1 \
Chris@16 44 , BOOST_PHOENIX_LIMIT \
Chris@16 45 , BOOST_PHOENIX_ADAPT_CALLABLE_VARARG_R \
Chris@16 46 , (NAME, FUNC) \
Chris@16 47 ) \
Chris@16 48 /**/
Chris@16 49
Chris@16 50 #define BOOST_PHOENIX_ADAPT_CALLABLE_VARARG_R(Z, N, D) \
Chris@16 51 BOOST_PHOENIX_ADAPT_CALLABLE( \
Chris@16 52 BOOST_PP_TUPLE_ELEM(2, 0, D) \
Chris@16 53 , BOOST_PP_TUPLE_ELEM(2, 1, D) \
Chris@16 54 , N \
Chris@16 55 ) \
Chris@16 56 /**/
Chris@16 57
Chris@16 58 #endif