set 1021 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // -*-c++-*-
  2. // vim: set ft=cpp:
  3. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  4. file Copyright.txt or https://cmake.org/licensing for details. */
  5. #pragma once
  6. #include <set> // IWYU pragma: export
  7. #include <cm/bits/erase_if.hxx>
  8. namespace cm {
  9. // should be updated when C++20 is finalized
  10. #if (__cplusplus > 201703L || \
  11. (defined(_MSVC_LANG) && _MSVC_LANG > 201703)) && \
  12. defined(__cpp_lib_erase_if)
  13. using std::erase_if;
  14. #else
  15. template <typename Key, typename Compare, typename Allocator,
  16. typename Predicate>
  17. inline void erase_if(std::set<Key, Compare, Allocator>& cont, Predicate pred)
  18. {
  19. internals::erase_if(cont, pred);
  20. }
  21. template <typename Key, typename Compare, typename Allocator,
  22. typename Predicate>
  23. inline void erase_if(std::multiset<Key, Compare, Allocator>& cont,
  24. Predicate pred)
  25. {
  26. internals::erase_if(cont, pred);
  27. }
  28. #endif
  29. } // namespace cm