Chris@16
|
1 // Copyright David Abrahams 2005. Distributed under the Boost
|
Chris@16
|
2 // Software License, Version 1.0. (See accompanying
|
Chris@16
|
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
4 #ifndef BOOST_PARAMETER_MATCH_DWA2005714_HPP
|
Chris@16
|
5 # define BOOST_PARAMETER_MATCH_DWA2005714_HPP
|
Chris@16
|
6
|
Chris@16
|
7 # include <boost/detail/workaround.hpp>
|
Chris@16
|
8 # include <boost/preprocessor/seq/enum.hpp>
|
Chris@16
|
9
|
Chris@16
|
10 # if BOOST_WORKAROUND(__MWERKS__, <= 0x3003)
|
Chris@16
|
11 // Temporary version of BOOST_PP_SEQ_ENUM until Paul M. integrates the workaround.
|
Chris@16
|
12 # define BOOST_PARAMETER_SEQ_ENUM_I(size,seq) BOOST_PP_CAT(BOOST_PP_SEQ_ENUM_, size) seq
|
Chris@16
|
13 # define BOOST_PARAMETER_SEQ_ENUM(seq) BOOST_PARAMETER_SEQ_ENUM_I(BOOST_PP_SEQ_SIZE(seq), seq)
|
Chris@16
|
14 # else
|
Chris@16
|
15 # define BOOST_PARAMETER_SEQ_ENUM(seq) BOOST_PP_SEQ_ENUM(seq)
|
Chris@16
|
16 # endif
|
Chris@16
|
17
|
Chris@16
|
18 # if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
Chris@16
|
19
|
Chris@16
|
20 # include <boost/parameter/config.hpp>
|
Chris@16
|
21 # include <boost/parameter/aux_/void.hpp>
|
Chris@16
|
22 # include <boost/preprocessor/arithmetic/sub.hpp>
|
Chris@16
|
23 # include <boost/preprocessor/facilities/intercept.hpp>
|
Chris@16
|
24 # include <boost/preprocessor/repetition/enum_trailing_params.hpp>
|
Chris@16
|
25
|
Chris@16
|
26 # define BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes) \
|
Chris@16
|
27 BOOST_PP_ENUM_TRAILING_PARAMS( \
|
Chris@16
|
28 BOOST_PP_SUB( \
|
Chris@16
|
29 BOOST_PARAMETER_MAX_ARITY \
|
Chris@16
|
30 , BOOST_PP_SEQ_SIZE(ArgTypes) \
|
Chris@16
|
31 ) \
|
Chris@16
|
32 , ::boost::parameter::void_ BOOST_PP_INTERCEPT \
|
Chris@16
|
33 )
|
Chris@16
|
34
|
Chris@16
|
35 # else
|
Chris@16
|
36
|
Chris@16
|
37 # define BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes)
|
Chris@16
|
38
|
Chris@16
|
39 # endif
|
Chris@16
|
40
|
Chris@16
|
41 //
|
Chris@16
|
42 // Generates, e.g.
|
Chris@16
|
43 //
|
Chris@16
|
44 // typename dfs_params::match<A1,A2>::type name = dfs_params()
|
Chris@16
|
45 //
|
Chris@16
|
46 // with workarounds for Borland compatibility.
|
Chris@16
|
47 //
|
Chris@16
|
48
|
Chris@16
|
49 # define BOOST_PARAMETER_MATCH(ParameterSpec, ArgTypes, name) \
|
Chris@16
|
50 typename ParameterSpec ::match< \
|
Chris@16
|
51 BOOST_PARAMETER_SEQ_ENUM(ArgTypes) \
|
Chris@16
|
52 BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes) \
|
Chris@16
|
53 >::type name = ParameterSpec ()
|
Chris@16
|
54
|
Chris@16
|
55 #endif // BOOST_PARAMETER_MATCH_DWA2005714_HPP
|