Debian Codegraph @

Utilities/std/cm/set

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