variant_collection_fwd.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* Copyright 2024 Joaquin M Lopez Munoz.
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * See http://www.boost.org/libs/poly_collection for library home page.
  7. */
  8. #ifndef BOOST_POLY_COLLECTION_VARIANT_COLLECTION_FWD_HPP
  9. #define BOOST_POLY_COLLECTION_VARIANT_COLLECTION_FWD_HPP
  10. #if defined(_MSC_VER)
  11. #pragma once
  12. #endif
  13. #include <boost/mp11/list.hpp>
  14. #include <memory>
  15. namespace boost{
  16. namespace poly_collection{
  17. namespace detail{
  18. template<typename... Ts> struct variant_model;
  19. }
  20. template<typename TypeList>
  21. using variant_collection_value_type=
  22. typename mp11::mp_rename<TypeList,detail::variant_model>::value_type;
  23. template<
  24. typename TypeList,
  25. typename Allocator=std::allocator<variant_collection_value_type<TypeList>>
  26. >
  27. class variant_collection;
  28. template<typename... Ts>
  29. using variant_collection_of=variant_collection<mp11::mp_list<Ts...>>;
  30. template<typename TypeList,typename Allocator>
  31. bool operator==(
  32. const variant_collection<TypeList,Allocator>& x,
  33. const variant_collection<TypeList,Allocator>& y);
  34. template<typename TypeList,typename Allocator>
  35. bool operator!=(
  36. const variant_collection<TypeList,Allocator>& x,
  37. const variant_collection<TypeList,Allocator>& y);
  38. template<typename TypeList,typename Allocator>
  39. void swap(
  40. variant_collection<TypeList,Allocator>& x,
  41. variant_collection<TypeList,Allocator>& y);
  42. } /* namespace poly_collection */
  43. using poly_collection::variant_collection;
  44. using poly_collection::variant_collection_of;
  45. } /* namespace boost */
  46. #endif