PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/spirit/home/phoenix/bind/detail/bind_function.hpp

http://hadesmem.googlecode.com/
C++ Header | 53 lines | 33 code | 9 blank | 11 comment | 0 complexity | 2a123a698c94a12ff11b57fd92716ccc MD5 | raw file
 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#if !defined(BOOST_PP_IS_ITERATING)
 8#if !defined(PHOENIX_BIND_DETAIL_BIND_FUNCTION_HPP)
 9#define PHOENIX_BIND_DETAIL_BIND_FUNCTION_HPP
10
11#include <boost/preprocessor/iterate.hpp>
12#include <boost/preprocessor/dec.hpp>
13#include <boost/preprocessor/repetition/enum_params.hpp>
14#include <boost/preprocessor/repetition/enum_binary_params.hpp>
15
16#define BOOST_PP_ITERATION_PARAMS_1                                             \
17    (3, (3, BOOST_PP_DEC(PHOENIX_COMPOSITE_LIMIT),                              \
18    "boost/spirit/home/phoenix/bind/detail/bind_function.hpp"))
19#include BOOST_PP_ITERATE()
20
21#endif
22
23///////////////////////////////////////////////////////////////////////////////
24//
25//  Preprocessor vertical repetition code
26//
27///////////////////////////////////////////////////////////////////////////////
28#else // defined(BOOST_PP_IS_ITERATING)
29
30#define N BOOST_PP_ITERATION()
31
32    template <typename RT
33      , BOOST_PP_ENUM_PARAMS(N, typename T)
34      , BOOST_PP_ENUM_PARAMS(N, typename A)>
35    inline actor<
36        typename as_composite<
37            detail::function_eval<N>
38          , detail::function_ptr<N, RT, RT(*)(BOOST_PP_ENUM_PARAMS(N, T))>
39          , BOOST_PP_ENUM_PARAMS(N, A)
40        >::type>
41    bind(RT(*f)(BOOST_PP_ENUM_PARAMS(N, T))
42      , BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& _))
43    {
44        typedef detail::function_ptr<
45            N, RT, RT(*)(BOOST_PP_ENUM_PARAMS(N, T))> fp_type;
46        return compose<detail::function_eval<N> >(
47            fp_type(f), BOOST_PP_ENUM_PARAMS(N, _));
48    }
49
50#undef N
51#endif // defined(BOOST_PP_IS_ITERATING)
52
53