blob: 0477e062515b7901b8a487eb38d5ccc17b75a519 [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001
Jeff Thompson3d613fd2013-10-15 15:39:04 -07002#if !defined(NDNBOOST_PP_IS_ITERATING)
Jeff Thompsona28eed82013-08-22 16:21:10 -07003
4///// header body
5
Jeff Thompson3d613fd2013-10-15 15:39:04 -07006#ifndef NDNBOOST_MPL_APPLY_FWD_HPP_INCLUDED
7#define NDNBOOST_MPL_APPLY_FWD_HPP_INCLUDED
Jeff Thompsona28eed82013-08-22 16:21:10 -07008
9// Copyright Aleksey Gurtovoy 2000-2004
10//
11// Distributed under the Boost Software License, Version 1.0.
12// (See accompanying file LICENSE_1_0.txt or copy at
13// http://www.boost.org/LICENSE_1_0.txt)
14//
15// See http://www.boost.org/libs/mpl for documentation.
16
17// $Id: apply_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
18// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
19// $Revision: 49267 $
20
Jeff Thompson3d613fd2013-10-15 15:39:04 -070021#if !defined(NDNBOOST_MPL_PREPROCESSING_MODE)
Jeff Thompsona28eed82013-08-22 16:21:10 -070022# include <ndnboost/mpl/aux_/na.hpp>
23#endif
24
25#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
26
Jeff Thompson3d613fd2013-10-15 15:39:04 -070027#if !defined(NDNBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
28 && !defined(NDNBOOST_MPL_PREPROCESSING_MODE)
Jeff Thompsona28eed82013-08-22 16:21:10 -070029
Jeff Thompson3d613fd2013-10-15 15:39:04 -070030# define NDNBOOST_MPL_PREPROCESSED_HEADER apply_fwd.hpp
Jeff Thompsona28eed82013-08-22 16:21:10 -070031# include <ndnboost/mpl/aux_/include_preprocessed.hpp>
32
33#else
34
35# include <ndnboost/mpl/limits/arity.hpp>
36# include <ndnboost/mpl/aux_/preprocessor/params.hpp>
37# include <ndnboost/mpl/aux_/preprocessor/default_params.hpp>
38# include <ndnboost/mpl/aux_/config/ctps.hpp>
39# include <ndnboost/mpl/aux_/nttp_decl.hpp>
40
41# include <ndnboost/preprocessor/comma_if.hpp>
42# include <ndnboost/preprocessor/iterate.hpp>
43# include <ndnboost/preprocessor/cat.hpp>
44
45// agurt, 15/jan/02: top-level 'apply' template gives an ICE on MSVC
46// (for known reasons)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070047#if NDNBOOST_WORKAROUND(NDNBOOST_MSVC, < 1300)
48# define NDNBOOST_MPL_CFG_NO_APPLY_TEMPLATE
Jeff Thompsona28eed82013-08-22 16:21:10 -070049#endif
50
51namespace ndnboost { namespace mpl {
52
53// local macro, #undef-ined at the end of the header
54# define AUX778076_APPLY_DEF_PARAMS(param, value) \
Jeff Thompson3d613fd2013-10-15 15:39:04 -070055 NDNBOOST_MPL_PP_DEFAULT_PARAMS( \
56 NDNBOOST_MPL_LIMIT_METAFUNCTION_ARITY \
Jeff Thompsona28eed82013-08-22 16:21:10 -070057 , param \
58 , value \
59 ) \
60 /**/
61
62# define AUX778076_APPLY_N_COMMA_PARAMS(n, param) \
Jeff Thompson3d613fd2013-10-15 15:39:04 -070063 NDNBOOST_PP_COMMA_IF(n) \
64 NDNBOOST_MPL_PP_PARAMS(n, param) \
Jeff Thompsona28eed82013-08-22 16:21:10 -070065 /**/
66
Jeff Thompson3d613fd2013-10-15 15:39:04 -070067# if !defined(NDNBOOST_MPL_CFG_NO_APPLY_TEMPLATE)
Jeff Thompsona28eed82013-08-22 16:21:10 -070068
Jeff Thompson3d613fd2013-10-15 15:39:04 -070069#if !defined(NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
Jeff Thompsona28eed82013-08-22 16:21:10 -070070// forward declaration
71template<
72 typename F, AUX778076_APPLY_DEF_PARAMS(typename T, na)
73 >
74struct apply;
75#else
76namespace aux {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070077template< NDNBOOST_AUX_NTTP_DECL(int, arity_) > struct apply_chooser;
Jeff Thompsona28eed82013-08-22 16:21:10 -070078}
79#endif
80
Jeff Thompson3d613fd2013-10-15 15:39:04 -070081# endif // NDNBOOST_MPL_CFG_NO_APPLY_TEMPLATE
Jeff Thompsona28eed82013-08-22 16:21:10 -070082
Jeff Thompson3d613fd2013-10-15 15:39:04 -070083#define NDNBOOST_PP_ITERATION_PARAMS_1 \
84 (3,(0, NDNBOOST_MPL_LIMIT_METAFUNCTION_ARITY, <ndnboost/mpl/apply_fwd.hpp>))
85#include NDNBOOST_PP_ITERATE()
Jeff Thompsona28eed82013-08-22 16:21:10 -070086
87
88# undef AUX778076_APPLY_N_COMMA_PARAMS
89# undef AUX778076_APPLY_DEF_PARAMS
90
91}}
92
Jeff Thompson3d613fd2013-10-15 15:39:04 -070093#endif // NDNBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
94#endif // NDNBOOST_MPL_APPLY_FWD_HPP_INCLUDED
Jeff Thompsona28eed82013-08-22 16:21:10 -070095
96///// iteration
97
98#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070099#define i_ NDNBOOST_PP_FRAME_ITERATION(1)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700100
101template<
102 typename F AUX778076_APPLY_N_COMMA_PARAMS(i_, typename T)
103 >
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700104struct NDNBOOST_PP_CAT(apply,i_);
Jeff Thompsona28eed82013-08-22 16:21:10 -0700105
106#undef i_
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700107#endif // NDNBOOST_PP_IS_ITERATING