[PATCH] D56622: [Algorithm] Add make_const_ref corresponding to make_const_ptr

Stephen Kelly via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 11 16:48:46 PST 2019


steveire created this revision.
steveire added a reviewer: aaron.ballman.
Herald added subscribers: llvm-commits, kristina, dexonsmith.

Repository:
  rL LLVM

https://reviews.llvm.org/D56622

Files:
  include/llvm/ADT/STLExtras.h


Index: include/llvm/ADT/STLExtras.h
===================================================================
--- include/llvm/ADT/STLExtras.h
+++ include/llvm/ADT/STLExtras.h
@@ -75,6 +75,12 @@
   using type =
       typename std::add_pointer<typename std::add_const<T>::type>::type;
 };
+
+template <typename T> struct make_const_ref {
+  using type = typename std::add_lvalue_reference<
+      typename std::add_const<T>::type>::type;
+};
+
 //===----------------------------------------------------------------------===//
 //     Extra additions to <functional>
 //===----------------------------------------------------------------------===//


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56622.181397.patch
Type: text/x-patch
Size: 642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190112/cd7a9f37/attachment.bin>


More information about the llvm-commits mailing list