From ec7802a102d49ab5c17495118d4fe0bcc7287beb Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 1 Oct 2015 20:57:57 +0100 Subject: Add DCHECKs to ArenaVector and ScopedArenaVector. Implement dchecked_vector<> template that DCHECK()s element access and insert()/emplace()/erase() positions. Change the ArenaVector<> and ScopedArenaVector<> aliases to use the new template instead of std::vector<>. Remove DCHECK()s that have now become unnecessary from the Optimizing compiler. Change-Id: Ib8506bd30d223f68f52bd4476c76d9991acacadc --- compiler/utils/array_ref.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'compiler/utils') 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 - explicit ArrayRef(std::vector& v) + template ::value>::type> + explicit ArrayRef(Vector& v) : array_(v.data()), size_(v.size()) { } - template - explicit ArrayRef(const std::vector& v, - typename std::enable_if::value, tag>::type - t ATTRIBUTE_UNUSED = tag()) + template ::type, + value_type>::value>::type> + explicit ArrayRef(const Vector& v) : array_(v.data()), size_(v.size()) { } -- cgit v1.2.3-59-g8ed1b