• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef BASE_CONTAINERS_CXX20_ERASE_H_
6 #define BASE_CONTAINERS_CXX20_ERASE_H_
7 
8 #include "base/containers/cxx20_erase_map.h"
9 #include "base/containers/cxx20_erase_vector.h"
10 
11 // Erase/EraseIf are based on C++20's uniform container erasure API:
12 // - https://eel.is/c++draft/libraryindex#:erase
13 // - https://eel.is/c++draft/libraryindex#:erase_if
14 // They provide a generic way to erase elements from a container.
15 // The functions here implement these for the standard containers until those
16 // functions are available in the C++ standard.
17 // Note: there is no std::erase for standard associative containers so we don't
18 // have it either.
19 
20 // This header is provided for convenience, so callers to Erase/EraseIf can just
21 // include this in their .cc file without thinking about which Erase/EraseIf
22 // specialization header to include. For uncommon cases where Erase/EraseIf are
23 // used in .h files, please include the specialization header to avoid bloating
24 // the header.
25 
26 #endif  // BASE_CONTAINERS_CXX20_ERASE_H_
27