tuple_expand.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  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. #ifndef BOOST_PP_IS_ITERATING
  7. #if !defined(FUSION_TUPLE_EXPAND_10032005_0815)
  8. #define FUSION_TUPLE_EXPAND_10032005_0815
  9. #include <boost/preprocessor/iterate.hpp>
  10. #include <boost/preprocessor/repetition/enum_params.hpp>
  11. #include <boost/preprocessor/repetition/enum_binary_params.hpp>
  12. #define BOOST_PP_FILENAME_1 \
  13. <boost/fusion/tuple/detail/tuple_expand.hpp>
  14. #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE)
  15. #include BOOST_PP_ITERATE()
  16. #endif
  17. #else // defined(BOOST_PP_IS_ITERATING)
  18. ///////////////////////////////////////////////////////////////////////////////
  19. //
  20. // Preprocessor vertical repetition code
  21. //
  22. ///////////////////////////////////////////////////////////////////////////////
  23. #define N BOOST_PP_ITERATION()
  24. BOOST_FUSION_GPU_ENABLED
  25. #if N == 1
  26. explicit
  27. #endif
  28. tuple(BOOST_PP_ENUM_BINARY_PARAMS(
  29. N, typename detail::call_param<T, >::type arg))
  30. : base_type(BOOST_PP_ENUM_PARAMS(N, arg)) {}
  31. template <BOOST_PP_ENUM_PARAMS(N, typename U)>
  32. BOOST_FUSION_GPU_ENABLED
  33. tuple(tuple<BOOST_PP_ENUM_PARAMS(N, U)> const& rhs)
  34. : base_type(rhs) {}
  35. template <BOOST_PP_ENUM_PARAMS(N, typename U)>
  36. BOOST_FUSION_GPU_ENABLED
  37. tuple& operator=(tuple<BOOST_PP_ENUM_PARAMS(N, U)> const& rhs)
  38. {
  39. base_type::operator=(rhs);
  40. return *this;
  41. }
  42. #undef N
  43. #endif // defined(BOOST_PP_IS_ITERATING)