unordered_flat_map_fwd.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright (C) 2022 Christian Mazakas
  2. // Copyright (C) 2024 Braden Ganetsky
  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. #ifndef BOOST_UNORDERED_FLAT_MAP_FWD_HPP_INCLUDED
  6. #define BOOST_UNORDERED_FLAT_MAP_FWD_HPP_INCLUDED
  7. #include <boost/config.hpp>
  8. #if defined(BOOST_HAS_PRAGMA_ONCE)
  9. #pragma once
  10. #endif
  11. #include <boost/container_hash/hash_fwd.hpp>
  12. #include <functional>
  13. #include <memory>
  14. #ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
  15. #include <memory_resource>
  16. #endif
  17. namespace boost {
  18. namespace unordered {
  19. template <class Key, class T, class Hash = boost::hash<Key>,
  20. class KeyEqual = std::equal_to<Key>,
  21. class Allocator = std::allocator<std::pair<const Key, T> > >
  22. class unordered_flat_map;
  23. template <class Key, class T, class Hash, class KeyEqual, class Allocator>
  24. bool operator==(
  25. unordered_flat_map<Key, T, Hash, KeyEqual, Allocator> const& lhs,
  26. unordered_flat_map<Key, T, Hash, KeyEqual, Allocator> const& rhs);
  27. template <class Key, class T, class Hash, class KeyEqual, class Allocator>
  28. bool operator!=(
  29. unordered_flat_map<Key, T, Hash, KeyEqual, Allocator> const& lhs,
  30. unordered_flat_map<Key, T, Hash, KeyEqual, Allocator> const& rhs);
  31. template <class Key, class T, class Hash, class KeyEqual, class Allocator>
  32. void swap(unordered_flat_map<Key, T, Hash, KeyEqual, Allocator>& lhs,
  33. unordered_flat_map<Key, T, Hash, KeyEqual, Allocator>& rhs)
  34. noexcept(noexcept(lhs.swap(rhs)));
  35. #ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
  36. namespace pmr {
  37. template <class Key, class T, class Hash = boost::hash<Key>,
  38. class KeyEqual = std::equal_to<Key> >
  39. using unordered_flat_map =
  40. boost::unordered::unordered_flat_map<Key, T, Hash, KeyEqual,
  41. std::pmr::polymorphic_allocator<std::pair<const Key, T> > >;
  42. } // namespace pmr
  43. #endif
  44. } // namespace unordered
  45. using boost::unordered::unordered_flat_map;
  46. } // namespace boost
  47. #endif