]> git.lyx.org Git - lyx.git/blob - boost/boost/mpl/aux_/apply.hpp
96e3f74cce41be09934da69c280b8b86f06c44d3
[lyx.git] / boost / boost / mpl / aux_ / apply.hpp
1 //-----------------------------------------------------------------------------
2 // boost mpl/aux_/apply.hpp header file
3 // See http://www.boost.org for updates, documentation, and revision history.
4 //-----------------------------------------------------------------------------
5 //
6 // Copyright (c) 2001-02
7 // Aleksey Gurtovoy
8 //
9 // Permission to use, copy, modify, distribute and sell this software
10 // and its documentation for any purpose is hereby granted without fee, 
11 // provided that the above copyright notice appears in all copies and 
12 // that both the copyright notice and this permission notice appear in 
13 // supporting documentation. No representations are made about the 
14 // suitability of this software for any purpose. It is provided "as is" 
15 // without express or implied warranty.
16
17 #ifndef BOOST_MPL_AUX_APPLY_HPP_INCLUDED
18 #define BOOST_MPL_AUX_APPLY_HPP_INCLUDED
19
20 #include "boost/mpl/aux_/config/dtp.hpp"
21 #include "boost/config.hpp"
22
23 #define BOOST_MPL_AUX_APPLY(arity, args) \
24     BOOST_PP_CAT(BOOST_MPL_AUX_APPLY,arity) args \
25 /**/
26
27 // agurt, 14/nov/02: temporary fix, need to research a couple of ICEs to
28 // get rid of this mess
29 #if defined(BOOST_MSVC) && BOOST_MSVC == 1300 && !defined(BOOST_MPL_PREPROCESSING_MODE)
30 #   include "boost/mpl/apply.hpp"
31 #endif
32
33 #if defined(BOOST_MPL_USE_APPLY_INTERNALLY) \
34     || defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) \
35     || defined(BOOST_MSVC) && (BOOST_MSVC < 1300 || BOOST_MSVC == 1300 && defined(BOOST_MPL_PREPROCESSING_MODE))
36
37 #   if !defined(BOOST_MPL_PREPROCESSING_MODE)
38 #       include "boost/mpl/apply.hpp"
39 #   endif
40
41 // tokenization takes place before macro expansion (see 2.1 [lex.phases] 
42 // para 3-4), so, strictly speaking, spaces between '<', 'f', and '>' tokens 
43 // below (BOOST_MPL_AUX_APPLY0) are not required; they are needed in practice, 
44 // though, because there is at least one compiler (MSVC 6.5) that does not 
45 // conform to the standard here
46 #   define BOOST_MPL_AUX_APPLY0(f) apply0< f >
47 #   define BOOST_MPL_AUX_APPLY1(f,a1) apply1<f,a1>
48 #   define BOOST_MPL_AUX_APPLY2(f,a1,a2) apply2<f,a1,a2>
49 #   define BOOST_MPL_AUX_APPLY3(f,a1,a2,a3) apply3<f,a1,a2,a3>
50 #   define BOOST_MPL_AUX_APPLY4(f,a1,a2,a3,a4) apply4<f,a1,a2,a3,a4>
51 #   define BOOST_MPL_AUX_APPLY5(f,a1,a2,a3,a4,a5) apply5<f,a1,a2,a3,a4,a5>
52 #   define BOOST_MPL_AUX_APPLY6(f,a1,a2,a3,a4,a5,a6) apply6<f,a1,a2,a3,a4,a5,a6>
53 #   define BOOST_MPL_AUX_APPLY7(f,a1,a2,a3,a4,a5,a6,a7) apply7<f,a1,a2,a3,a4,a5,a6,a7>
54 #   define BOOST_MPL_AUX_APPLY8(f,a1,a2,a3,a4,a5,a6,a7,a8) apply8<f,a1,a2,a3,a4,a5,a6,a7,a8>
55 #   define BOOST_MPL_AUX_APPLY9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) apply9<f,a1,a2,a3,a4,a5,a6,a7,a8,a9>
56
57 #else
58
59 #   define BOOST_MPL_AUX_APPLY0(f) f
60 #   define BOOST_MPL_AUX_APPLY1(f,a1) f::template apply<a1>
61 #   define BOOST_MPL_AUX_APPLY2(f,a1,a2) f::template apply<a1,a2>
62 #   define BOOST_MPL_AUX_APPLY3(f,a1,a2,a3) f::template apply<a1,a2,a3>
63 #   define BOOST_MPL_AUX_APPLY4(f,a1,a2,a3,a4) f::template apply<a1,a2,a3,a4>
64 #   define BOOST_MPL_AUX_APPLY5(f,a1,a2,a3,a4,a5) f::template apply<a1,a2,a3,a4,a5>
65 #   define BOOST_MPL_AUX_APPLY6(f,a1,a2,a3,a4,a5,a6) f::template apply<a1,a2,a3,a4,a5,a6>
66 #   define BOOST_MPL_AUX_APPLY7(f,a1,a2,a3,a4,a5,a6,a7) f::template apply<a1,a2,a3,a4,a5,a6,a7>
67 #   define BOOST_MPL_AUX_APPLY8(f,a1,a2,a3,a4,a5,a6,a7,a8) f::template apply<a1,a2,a3,a4,a5,a6,a7,a8>
68 #   define BOOST_MPL_AUX_APPLY9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) f::template apply<a1,a2,a3,a4,a5,a6,a7,a8,a9>
69
70 #endif
71
72 #endif // BOOST_MPL_AUX_APPLY_HPP_INCLUDED