summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2019-01-12 15:23:30 +0000
committerStephen Kelly <steveire@gmail.com>2019-01-12 15:23:30 +0000
commit1b4a240bfe2f548f29beec177fdc2792290872c5 (patch)
tree9355cdf62f6fe455d64f7b2c99daa9044a3149a4
parent625d5aef628968e90803c3b8edd4d537c007aaf8 (diff)
downloadbcm5719-llvm-1b4a240bfe2f548f29beec177fdc2792290872c5.tar.gz
bcm5719-llvm-1b4a240bfe2f548f29beec177fdc2792290872c5.zip
[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
-rw-r--r--llvm/include/llvm/ADT/STLExtras.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index 8685f0e4aad..f66ca7c08a7 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -75,6 +75,12 @@ template <typename T> struct make_const_ptr {
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>
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud