concurrent_flat_map_fwd.hpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* Fast open-addressing concurrent hashmap.
  2. *
  3. * Copyright 2023 Christian Mazakas.
  4. * Copyright 2024 Braden Ganetsky.
  5. * Distributed under the Boost Software License, Version 1.0.
  6. * (See accompanying file LICENSE_1_0.txt or copy at
  7. * http://www.boost.org/LICENSE_1_0.txt)
  8. *
  9. * See https://www.boost.org/libs/unordered for library home page.
  10. */
  11. #ifndef BOOST_UNORDERED_CONCURRENT_FLAT_MAP_FWD_HPP
  12. #define BOOST_UNORDERED_CONCURRENT_FLAT_MAP_FWD_HPP
  13. #include <boost/config.hpp>
  14. #include <boost/container_hash/hash_fwd.hpp>
  15. #include <functional>
  16. #include <memory>
  17. #ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
  18. #include <memory_resource>
  19. #endif
  20. namespace boost {
  21. namespace unordered {
  22. template <class Key, class T, class Hash = boost::hash<Key>,
  23. class Pred = std::equal_to<Key>,
  24. class Allocator = std::allocator<std::pair<Key const, T> > >
  25. class concurrent_flat_map;
  26. template <class Key, class T, class Hash, class KeyEqual, class Allocator>
  27. bool operator==(
  28. concurrent_flat_map<Key, T, Hash, KeyEqual, Allocator> const& lhs,
  29. concurrent_flat_map<Key, T, Hash, KeyEqual, Allocator> const& rhs);
  30. template <class Key, class T, class Hash, class KeyEqual, class Allocator>
  31. bool operator!=(
  32. concurrent_flat_map<Key, T, Hash, KeyEqual, Allocator> const& lhs,
  33. concurrent_flat_map<Key, T, Hash, KeyEqual, Allocator> const& rhs);
  34. template <class Key, class T, class Hash, class Pred, class Alloc>
  35. void swap(concurrent_flat_map<Key, T, Hash, Pred, Alloc>& x,
  36. concurrent_flat_map<Key, T, Hash, Pred, Alloc>& y)
  37. noexcept(noexcept(x.swap(y)));
  38. template <class K, class T, class H, class P, class A, class Predicate>
  39. typename concurrent_flat_map<K, T, H, P, A>::size_type erase_if(
  40. concurrent_flat_map<K, T, H, P, A>& c, Predicate pred);
  41. #ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
  42. namespace pmr {
  43. template <class Key, class T, class Hash = boost::hash<Key>,
  44. class Pred = std::equal_to<Key> >
  45. using concurrent_flat_map = boost::unordered::concurrent_flat_map<Key, T,
  46. Hash, Pred, std::pmr::polymorphic_allocator<std::pair<Key const, T> > >;
  47. } // namespace pmr
  48. #endif
  49. } // namespace unordered
  50. using boost::unordered::concurrent_flat_map;
  51. } // namespace boost
  52. #endif // BOOST_UNORDERED_CONCURRENT_FLAT_MAP_HPP