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