[PATCH] D132628: [ADT] Make `llvm::identity` a transparent function object

Joe Loser via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 20:07:50 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG77eac327167c: [ADT] Make `llvm::identity` a transparent function object (authored by jloser).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132628/new/

https://reviews.llvm.org/D132628

Files:
  llvm/include/llvm/ADT/identity.h


Index: llvm/include/llvm/ADT/identity.h
===================================================================
--- llvm/include/llvm/ADT/identity.h
+++ llvm/include/llvm/ADT/identity.h
@@ -18,7 +18,9 @@
 
 namespace llvm {
 
+// Similar to `std::identity` from C++20.
 template <class Ty> struct identity {
+  using is_transparent = void;
   using argument_type = Ty;
 
   Ty &operator()(Ty &self) const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132628.455779.patch
Type: text/x-patch
Size: 403 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220826/4ab80581/attachment.bin>


More information about the llvm-commits mailing list