From 1b4a240bfe2f548f29beec177fdc2792290872c5 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 llvm-svn: 351009 --- llvm/include/llvm/ADT/STLExtras.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index 8685f0e..f66ca7c 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/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.7.4