list.hpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. #if !defined(FUSION_LIST_07172005_1153)
  7. #define FUSION_LIST_07172005_1153
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/support/void.hpp>
  10. #include <boost/fusion/support/detail/enabler.hpp>
  11. #include <boost/fusion/container/list/detail/cpp03/list_fwd.hpp>
  12. #include <boost/fusion/container/list/detail/cpp03/list_to_cons.hpp>
  13. #include <boost/fusion/support/is_sequence.hpp>
  14. #include <boost/core/enable_if.hpp>
  15. #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
  16. #include <boost/fusion/container/list/detail/cpp03/preprocessed/list.hpp>
  17. #else
  18. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  19. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/list" FUSION_MAX_LIST_SIZE_STR ".hpp")
  20. #endif
  21. /*=============================================================================
  22. Copyright (c) 2001-2011 Joel de Guzman
  23. Distributed under the Boost Software License, Version 1.0. (See accompanying
  24. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  25. This is an auto-generated file. Do not edit!
  26. ==============================================================================*/
  27. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  28. #pragma wave option(preserve: 1)
  29. #endif
  30. namespace boost { namespace fusion
  31. {
  32. struct nil_;
  33. struct void_;
  34. template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename T)>
  35. struct list
  36. : detail::list_to_cons<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, T)>::type
  37. {
  38. private:
  39. typedef
  40. detail::list_to_cons<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, T)>
  41. list_to_cons;
  42. typedef typename list_to_cons::type inherited_type;
  43. public:
  44. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  45. list()
  46. : inherited_type() {}
  47. template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename U)>
  48. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  49. list(list<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, U)> const& rhs)
  50. : inherited_type(rhs) {}
  51. template <typename Sequence>
  52. BOOST_FUSION_GPU_ENABLED
  53. list(Sequence const& rhs
  54. , typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
  55. : inherited_type(rhs) {}
  56. // Expand a couple of forwarding constructors for arguments
  57. // of type (T0), (T0, T1), (T0, T1, T2) etc. Exanple:
  58. //
  59. // list(
  60. // typename detail::call_param<T0>::type arg0
  61. // , typename detail::call_param<T1>::type arg1)
  62. // : inherited_type(list_to_cons::call(arg0, arg1)) {}
  63. #include <boost/fusion/container/list/detail/cpp03/list_forward_ctor.hpp>
  64. template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename U)>
  65. BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  66. list&
  67. operator=(list<BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, U)> const& rhs)
  68. {
  69. inherited_type::operator=(rhs);
  70. return *this;
  71. }
  72. template <typename Sequence>
  73. BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  74. typename boost::enable_if<traits::is_sequence<Sequence>, list&>::type
  75. operator=(Sequence const& rhs)
  76. {
  77. inherited_type::operator=(rhs);
  78. return *this;
  79. }
  80. };
  81. }}
  82. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  83. #pragma wave option(output: null)
  84. #endif
  85. #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
  86. #endif