summaryrefslogtreecommitdiff
path: root/boost/phoenix/scope/detail/local_gen.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/phoenix/scope/detail/local_gen.hpp')
-rw-r--r--boost/phoenix/scope/detail/local_gen.hpp73
1 files changed, 27 insertions, 46 deletions
diff --git a/boost/phoenix/scope/detail/local_gen.hpp b/boost/phoenix/scope/detail/local_gen.hpp
index e4223326b3..3bd0c74bdd 100644
--- a/boost/phoenix/scope/detail/local_gen.hpp
+++ b/boost/phoenix/scope/detail/local_gen.hpp
@@ -1,66 +1,47 @@
-#if !BOOST_PHOENIX_IS_ITERATING
/*==============================================================================
- Copyright (c) 2005-2010 Joel de Guzman
- Copyright (c) 2010 Thomas Heller
+ Copyright (c) 2016 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
-#include <boost/phoenix/support/iterate.hpp>
-
-#define BOOST_PHOENIX_EXTRACT_LOCAL_TYPE(Z, N, D) \
- typename proto::detail::uncvref< \
- typename proto::result_of::child_c< \
- BOOST_PP_CAT(A, N) \
- , 1 \
- >::type \
- >::type
-/**/
-
-#define BOOST_PHOENIX_EXTRACT_LOCAL(Z, N, D) \
- proto::child_c<1>(BOOST_PP_CAT(a, N)) \
-/**/
-
-#define BOOST_PHOENIX_EXTRACT_LOCAL_KEY(Z, N, D) \
- typename proto::detail::uncvref< \
- typename proto::result_of::value< \
- typename proto::result_of::child_c< \
- BOOST_PP_CAT(A, N) \
- , 0 \
- >::type \
- >::type \
- >::type
-/**/
-
-#define BOOST_PHOENIX_ITERATION_PARAMS \
- (3, (1, BOOST_PHOENIX_LOCAL_LIMIT, \
- <boost/phoenix/scope/detail/local_gen.hpp>))
-#include BOOST_PHOENIX_ITERATE()
-
-#else
-
- template <BOOST_PHOENIX_typename_A>
+ template <typename... A>
BOOST_PHOENIX_SCOPE_ACTOR_GEN_NAME<
- BOOST_PP_CAT(vector, BOOST_PHOENIX_ITERATION)<BOOST_PP_ENUM(BOOST_PHOENIX_ITERATION, BOOST_PHOENIX_EXTRACT_LOCAL_TYPE, _)>
- , detail::map_local_index_to_tuple<BOOST_PP_ENUM(BOOST_PHOENIX_ITERATION, BOOST_PHOENIX_EXTRACT_LOCAL_KEY, _)>
+ typename vector_chooser<sizeof...(A)>::template apply<
+ typename proto::detail::uncvref<
+ typename proto::result_of::child_c<A, 1>::type
+ >::type...
+ >::type
+ , detail::map_local_index_to_tuple<
+ typename proto::detail::uncvref<
+ typename proto::result_of::value<
+ typename proto::result_of::child_c<A, 0>::type
+ >::type
+ >::type...
+ >
>
- BOOST_PHOENIX_SCOPE_ACTOR_GEN_FUNCTION (BOOST_PHOENIX_A_const_ref_a) BOOST_PHOENIX_SCOPE_ACTOR_GEN_CONST
+ BOOST_PHOENIX_SCOPE_ACTOR_GEN_FUNCTION(A const&... a) BOOST_PHOENIX_SCOPE_ACTOR_GEN_CONST
{
typedef
- BOOST_PP_CAT(vector, BOOST_PHOENIX_ITERATION)<BOOST_PP_ENUM(BOOST_PHOENIX_ITERATION, BOOST_PHOENIX_EXTRACT_LOCAL_TYPE, _)>
- locals_type;
+ typename vector_chooser<sizeof...(A)>::template apply<
+ typename proto::detail::uncvref<
+ typename proto::result_of::child_c<A, 1>::type
+ >::type...
+ >::type
+ locals_type;
- locals_type locals = {BOOST_PP_ENUM(BOOST_PHOENIX_ITERATION, BOOST_PHOENIX_EXTRACT_LOCAL, _)};
+ locals_type locals = {proto::child_c<1>(a)...};
return
BOOST_PHOENIX_SCOPE_ACTOR_GEN_NAME<
locals_type
, detail::map_local_index_to_tuple<
- BOOST_PP_ENUM(BOOST_PHOENIX_ITERATION, BOOST_PHOENIX_EXTRACT_LOCAL_KEY, _)
+ typename proto::detail::uncvref<
+ typename proto::result_of::value<
+ typename proto::result_of::child_c<A, 0>::type
+ >::type
+ >::type...
>
>(locals);
}
-#endif
-