diff options
| author | Kazu Hirata <kazu@google.com> | 2025-10-19 08:33:59 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-19 08:33:59 -0700 |
| commit | 622605e69482862914febfaeaf036aae011e0786 (patch) | |
| tree | 1d0cc38fa0bd1c64b22b4406089529a9d20a117d /clang/unittests/Format/FormatTestJava.cpp | |
| parent | 5805e4d1a05e5faf805bb28b5ba5604d58834e45 (diff) | |
| download | llvm-622605e69482862914febfaeaf036aae011e0786.zip llvm-622605e69482862914febfaeaf036aae011e0786.tar.gz llvm-622605e69482862914febfaeaf036aae011e0786.tar.bz2 | |
[ADT] Add C++20-style llvm::identity_cxx20 (#164143)
Currently, our llvm::identity<T> is not quite like std::identity from
C++20. Ours is a template struct while std::identity is a
non-template struct with templatized operator(). This difference
means that we cannot mechanically replace llvm::identity with
std::identity when we switch to C++20 in the future.
This patch implements llvm::identity_cxx20, which behaves exactly like
std::identity.
Once this patch lands, I'm planning to migrate users of llvm::identity
to the new style. There aren't that many:
- 4 instances of SparseSet<...>
- 3 instances of SparseMultiSet<...>
- about 50 instances of IndexedMap<...>
Diffstat (limited to 'clang/unittests/Format/FormatTestJava.cpp')
0 files changed, 0 insertions, 0 deletions
