local_gen.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*==============================================================================
  2. Copyright (c) 2016 Kohei Takahashi
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. template <typename... A>
  7. BOOST_PHOENIX_SCOPE_ACTOR_GEN_NAME<
  8. typename vector_chooser<sizeof...(A)>::template apply<
  9. typename proto::detail::uncvref<
  10. typename proto::result_of::child_c<A, 1>::type
  11. >::type...
  12. >::type
  13. , detail::map_local_index_to_tuple<
  14. typename proto::detail::uncvref<
  15. typename proto::result_of::value<
  16. typename proto::result_of::child_c<A, 0>::type
  17. >::type
  18. >::type...
  19. >
  20. >
  21. BOOST_PHOENIX_SCOPE_ACTOR_GEN_FUNCTION(A const&... a) BOOST_PHOENIX_SCOPE_ACTOR_GEN_CONST
  22. {
  23. typedef
  24. typename vector_chooser<sizeof...(A)>::template apply<
  25. typename proto::detail::uncvref<
  26. typename proto::result_of::child_c<A, 1>::type
  27. >::type...
  28. >::type
  29. locals_type;
  30. locals_type locals = {proto::child_c<1>(a)...};
  31. return
  32. BOOST_PHOENIX_SCOPE_ACTOR_GEN_NAME<
  33. locals_type
  34. , detail::map_local_index_to_tuple<
  35. typename proto::detail::uncvref<
  36. typename proto::result_of::value<
  37. typename proto::result_of::child_c<A, 0>::type
  38. >::type
  39. >::type...
  40. >
  41. >(locals);
  42. }