diff options
| author | 2014-09-25 18:08:03 +0000 | |
|---|---|---|
| committer | 2014-09-25 18:08:04 +0000 | |
| commit | 1ed5b27ee329208fd8ae22b8a9a61d708e2c1ffb (patch) | |
| tree | e80187277f4a41c9b41a25ebb6dd9567b66fd2bf /compiler/utils/array_ref.h | |
| parent | 34bb808affbed7a1db177b9ef4ab5461c2b2106b (diff) | |
| parent | f4da675bbc4615c5f854c81964cac9dd1153baea (diff) | |
Merge "Implement method calls using relative BL on ARM."
Diffstat (limited to 'compiler/utils/array_ref.h')
| -rw-r--r-- | compiler/utils/array_ref.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/compiler/utils/array_ref.h b/compiler/utils/array_ref.h index 2d70b7dd31..e6b4a6a47c 100644 --- a/compiler/utils/array_ref.h +++ b/compiler/utils/array_ref.h @@ -82,12 +82,13 @@ class ArrayRef { : array_(array), size_(size) { } - explicit ArrayRef(std::vector<T>& v) + template <typename Alloc> + explicit ArrayRef(std::vector<T, Alloc>& v) : array_(v.data()), size_(v.size()) { } - template <typename U> - ArrayRef(const std::vector<U>& v, + template <typename U, typename Alloc> + ArrayRef(const std::vector<U, Alloc>& v, typename std::enable_if<std::is_same<T, const U>::value, tag>::tag t = tag()) : array_(v.data()), size_(v.size()) { } @@ -167,6 +168,16 @@ class ArrayRef { size_t size_; }; +template <typename T> +bool operator==(const ArrayRef<T>& lhs, const ArrayRef<T>& rhs) { + return lhs.size() == rhs.size() && std::equal(lhs.begin(), lhs.end(), rhs.begin()); +} + +template <typename T> +bool operator!=(const ArrayRef<T>& lhs, const ArrayRef<T>& rhs) { + return !(lhs == rhs); +} + } // namespace art |