From 2a9e5ad32e9df64f89df4f58f5b49c74ee3e07f4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 12 Jan 2019 15:23:30 +0000 Subject: [PATCH] [Algorithm] Add make_const_ref corresponding to make_const_ptr Reviewers: aaron.ballman Subscribers: dexonsmith, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D56622 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351009 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/STLExtras.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h index 8685f0e4aad..f66ca7c08a7 100644 --- a/include/llvm/ADT/STLExtras.h +++ b/include/llvm/ADT/STLExtras.h @@ -75,6 +75,12 @@ template struct make_const_ptr { using type = typename std::add_pointer::type>::type; }; + +template struct make_const_ref { + using type = typename std::add_lvalue_reference< + typename std::add_const::type>::type; +}; + //===----------------------------------------------------------------------===// // Extra additions to //===----------------------------------------------------------------------===// -- 2.50.1