summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-10-08 15:47:08 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-10-08 15:47:08 +0000
commit359f77c44dafef7ebed027180422ee75eef1467c (patch)
treeb4b7fd4f8bf646dcd106351aaf2f5c1e6d719911 /compiler/utils
parent64d8d93aa9359b1126513dba92e27dbe184bfe3a (diff)
parentec7802a102d49ab5c17495118d4fe0bcc7287beb (diff)
Merge "Add DCHECKs to ArenaVector and ScopedArenaVector."
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/array_ref.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/compiler/utils/array_ref.h b/compiler/utils/array_ref.h
index 48f0328dce..5c33639a6a 100644
--- a/compiler/utils/array_ref.h
+++ b/compiler/utils/array_ref.h
@@ -77,15 +77,19 @@ class ArrayRef {
: array_(array_in), size_(size_in) {
}
- template <typename Alloc>
- explicit ArrayRef(std::vector<T, Alloc>& v)
+ template <typename Vector,
+ typename = typename std::enable_if<
+ std::is_same<typename Vector::value_type, value_type>::value>::type>
+ explicit ArrayRef(Vector& v)
: array_(v.data()), size_(v.size()) {
}
- template <typename U, typename Alloc>
- explicit ArrayRef(const std::vector<U, Alloc>& v,
- typename std::enable_if<std::is_same<T, const U>::value, tag>::type
- t ATTRIBUTE_UNUSED = tag())
+ template <typename Vector,
+ typename = typename std::enable_if<
+ std::is_same<
+ typename std::add_const<typename Vector::value_type>::type,
+ value_type>::value>::type>
+ explicit ArrayRef(const Vector& v)
: array_(v.data()), size_(v.size()) {
}