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