]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | |
2 | // Copyright (C) 2009-2012 Lorenzo Caminiti | |
3 | // Distributed under the Boost Software License, Version 1.0 | |
4 | // (see accompanying file LICENSE_1_0.txt or a copy at | |
5 | // http://www.boost.org/LICENSE_1_0.txt) | |
6 | // Home at http://www.boost.org/libs/local_function | |
7 | ||
8 | #ifndef BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_HPP_ | |
9 | #define BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_HPP_ | |
10 | ||
11 | #include <boost/preprocessor/tuple/elem.hpp> | |
12 | ||
13 | // PRIVATE // | |
14 | ||
15 | // Param 2-tuple `([auto | register] type name, default_value)`. | |
16 | #define BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_DECL_ 0 | |
17 | #define BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_DEFAULT_ 1 | |
18 | #define BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_MAX_ 2 | |
19 | ||
20 | // PUBLIC // | |
21 | ||
22 | // Expand: `[auto | register] type_ name_` (parameter declaration). | |
23 | #define BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DECL(param_traits) \ | |
24 | BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_MAX_, \ | |
25 | BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_DECL_, param_traits) | |
26 | ||
27 | // Expand: `default ... EMPTY()` if default value, `EMPTY()` otherwise. | |
28 | // Leading default is kept because default value might not be alphanumeric | |
29 | // (e.g., -123) so failing `CAT` for `IS_EMPTY` check. | |
30 | #define BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DEFAULT(param_traits) \ | |
31 | BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_MAX_, \ | |
32 | BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_DEFAULT_, \ | |
33 | param_traits)(/* expand EMPTY */) | |
34 | ||
35 | #endif // #include guard | |
36 |