concurrent_flat_set_fwd.hpp 2.2 KB

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