set.hpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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_SET_09162005_1104)
  7. #define FUSION_SET_09162005_1104
  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/support/is_sequence.hpp>
  12. #include <boost/fusion/support/sequence_base.hpp>
  13. #include <boost/fusion/support/category_of.hpp>
  14. #include <boost/fusion/support/detail/access.hpp>
  15. #include <boost/fusion/container/set/set_fwd.hpp>
  16. #include <boost/fusion/container/set/detail/begin_impl.hpp>
  17. #include <boost/fusion/container/set/detail/end_impl.hpp>
  18. #include <boost/fusion/container/set/detail/value_of_impl.hpp>
  19. #include <boost/fusion/container/set/detail/deref_data_impl.hpp>
  20. #include <boost/fusion/container/set/detail/deref_impl.hpp>
  21. #include <boost/fusion/container/set/detail/key_of_impl.hpp>
  22. #include <boost/fusion/container/set/detail/value_of_data_impl.hpp>
  23. #include <boost/fusion/container/vector/vector.hpp>
  24. #include <boost/mpl/identity.hpp>
  25. #include <boost/mpl/bool.hpp>
  26. #include <boost/core/enable_if.hpp>
  27. #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
  28. #include <boost/fusion/container/set/detail/cpp03/preprocessed/set.hpp>
  29. #else
  30. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  31. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/set" FUSION_MAX_SET_SIZE_STR ".hpp")
  32. #endif
  33. /*=============================================================================
  34. Copyright (c) 2001-2011 Joel de Guzman
  35. Distributed under the Boost Software License, Version 1.0. (See accompanying
  36. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  37. This is an auto-generated file. Do not edit!
  38. ==============================================================================*/
  39. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  40. #pragma wave option(preserve: 1)
  41. #endif
  42. namespace boost { namespace fusion
  43. {
  44. struct fusion_sequence_tag;
  45. template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_SET_SIZE, typename T)>
  46. struct set : sequence_base<set<BOOST_PP_ENUM_PARAMS(FUSION_MAX_SET_SIZE, T)> >
  47. {
  48. struct category : forward_traversal_tag, associative_tag {};
  49. typedef set_tag fusion_tag;
  50. typedef fusion_sequence_tag tag; // this gets picked up by MPL
  51. typedef mpl::false_ is_view;
  52. typedef vector<
  53. BOOST_PP_ENUM_PARAMS(FUSION_MAX_SET_SIZE, T)>
  54. storage_type;
  55. typedef typename storage_type::size size;
  56. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  57. set()
  58. : data() {}
  59. template <typename Sequence>
  60. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  61. set(Sequence const& rhs
  62. , typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
  63. : data(rhs) {}
  64. #include <boost/fusion/container/set/detail/cpp03/set_forward_ctor.hpp>
  65. template <typename T>
  66. BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  67. set&
  68. operator=(T const& rhs)
  69. {
  70. data = rhs;
  71. return *this;
  72. }
  73. BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  74. storage_type& get_data() { return data; }
  75. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  76. storage_type const& get_data() const { return data; }
  77. private:
  78. storage_type data;
  79. };
  80. }}
  81. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  82. #pragma wave option(output: null)
  83. #endif
  84. #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
  85. #endif