segment_map.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_DETAIL_SEGMENT_MAP_HPP
  9. #define BOOST_POLY_COLLECTION_DETAIL_SEGMENT_MAP_HPP
  10. #if defined(_MSC_VER)
  11. #pragma once
  12. #endif
  13. #include <boost/poly_collection/detail/size_t_map.hpp>
  14. #include <boost/poly_collection/detail/type_info_map.hpp>
  15. namespace boost{
  16. namespace poly_collection{
  17. namespace detail{
  18. template<typename Key> struct segment_map_helper;
  19. template<> struct segment_map_helper<std::type_info>
  20. {
  21. template<typename... Args> using fn=type_info_map<Args...>;
  22. };
  23. template<> struct segment_map_helper<std::size_t>
  24. {
  25. template<typename... Args> using fn=size_t_map<Args...>;
  26. };
  27. template<typename Key,typename... Args>
  28. using segment_map=typename segment_map_helper<Key>::template fn<Args...>;
  29. } /* namespace poly_collection::detail */
  30. } /* namespace poly_collection */
  31. } /* namespace boost */
  32. #endif