| 1 | // Copyright Daniel Wallin 2006. |
| 2 | // Copyright Cromwell D. Enage 2017. |
| 3 | // Distributed under the Boost Software License, Version 1.0. |
| 4 | // (See accompanying file LICENSE_1_0.txt or copy at |
| 5 | // http://www.boost.org/LICENSE_1_0.txt) |
| 6 | |
| 7 | #ifndef BOOST_PARAMETER_AUX_PP_IMPL_ARGUMENT_PACK_HPP |
| 8 | #define BOOST_PARAMETER_AUX_PP_IMPL_ARGUMENT_PACK_HPP |
| 9 | |
| 10 | #include <boost/parameter/aux_/pack/tag_keyword_arg.hpp> |
| 11 | #include <boost/parameter/aux_/pack/make_arg_list.hpp> |
| 12 | #include <boost/parameter/config.hpp> |
| 13 | |
| 14 | #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) |
| 15 | #include <boost/parameter/aux_/pack/make_parameter_spec_items.hpp> |
| 16 | |
| 17 | #if defined(BOOST_PARAMETER_CAN_USE_MP11) |
| 18 | #include <boost/mp11/integral.hpp> |
| 19 | #include <boost/mp11/list.hpp> |
| 20 | #else |
| 21 | #include <boost/mpl/bool.hpp> |
| 22 | #include <boost/mpl/pair.hpp> |
| 23 | #endif |
| 24 | |
| 25 | namespace boost { namespace parameter { namespace aux { |
| 26 | |
| 27 | template <typename Parameters, typename ...Args> |
| 28 | struct argument_pack |
| 29 | { |
| 30 | typedef typename ::boost::parameter::aux::make_arg_list< |
| 31 | typename ::boost::parameter::aux::make_parameter_spec_items< |
| 32 | typename Parameters::parameter_spec |
| 33 | , Args... |
| 34 | >::type |
| 35 | , typename Parameters::deduced_list |
| 36 | , ::boost::parameter::aux::tag_keyword_arg |
| 37 | #if defined(BOOST_PARAMETER_CAN_USE_MP11) |
| 38 | , ::boost::mp11::mp_false |
| 39 | #else |
| 40 | , ::boost::mpl::false_ |
| 41 | #endif |
| 42 | >::type result; |
| 43 | #if defined(BOOST_PARAMETER_CAN_USE_MP11) |
| 44 | using type = ::boost::mp11::mp_at_c<result,0>; |
| 45 | #else |
| 46 | typedef typename ::boost::mpl::first<result>::type type; |
| 47 | #endif |
| 48 | }; |
| 49 | }}} // namespace boost::parameter::aux |
| 50 | |
| 51 | #else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) |
| 52 | #include <boost/parameter/aux_/void.hpp> |
| 53 | #include <boost/parameter/aux_/pack/make_items.hpp> |
| 54 | #include <boost/parameter/aux_/preprocessor/no_perfect_forwarding_begin.hpp> |
| 55 | #include <boost/preprocessor/facilities/intercept.hpp> |
| 56 | #include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp> |
| 57 | #include <boost/mpl/bool.hpp> |
| 58 | #include <boost/mpl/pair.hpp> |
| 59 | |
| 60 | namespace boost { namespace parameter { namespace aux { |
| 61 | |
| 62 | template < |
| 63 | typename Parameters |
| 64 | BOOST_PP_ENUM_TRAILING_BINARY_PARAMS( |
| 65 | BOOST_PARAMETER_MAX_ARITY |
| 66 | , typename A |
| 67 | , = ::boost::parameter::void_ BOOST_PP_INTERCEPT |
| 68 | ) |
| 69 | > |
| 70 | struct argument_pack |
| 71 | { |
| 72 | typedef typename ::boost::parameter::aux::make_arg_list< |
| 73 | typename BOOST_PARAMETER_build_arg_list( |
| 74 | BOOST_PARAMETER_MAX_ARITY |
| 75 | , ::boost::parameter::aux::make_items |
| 76 | , typename Parameters::parameter_spec |
| 77 | , A |
| 78 | )::type |
| 79 | , typename Parameters::deduced_list |
| 80 | , ::boost::parameter::aux::tag_keyword_arg |
| 81 | , ::boost::mpl::false_ |
| 82 | >::type result; |
| 83 | typedef typename ::boost::mpl::first<result>::type type; |
| 84 | }; |
| 85 | }}} // namespace boost::parameter::aux |
| 86 | |
| 87 | #include <boost/parameter/aux_/preprocessor/no_perfect_forwarding_end.hpp> |
| 88 | |
| 89 | #endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING |
| 90 | #endif // include guard |
| 91 | |
| 92 | |