diff options
| author | 2015-07-15 08:59:43 +0000 | |
|---|---|---|
| committer | 2015-07-15 08:59:44 +0000 | |
| commit | 172c8f71a866931728c389a46ae9e69bc4c04a13 (patch) | |
| tree | 4b293ebd35db359f1c13024fd45b004b792ffb1e /compiler/utils/array_ref.h | |
| parent | 76ca82063ac62488fefb0b12d40026f4ebb2e198 (diff) | |
| parent | 345f93e8533e5b5af1e567d1c9d2e21f96c69258 (diff) | |
Merge "Avoid unexpected conversions to ArrayRef."
Diffstat (limited to 'compiler/utils/array_ref.h')
| -rw-r--r-- | compiler/utils/array_ref.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/utils/array_ref.h b/compiler/utils/array_ref.h index ff5a77c97a..303e0d5ad4 100644 --- a/compiler/utils/array_ref.h +++ b/compiler/utils/array_ref.h @@ -62,14 +62,14 @@ class ArrayRef { } template <size_t size> - constexpr ArrayRef(T (&array)[size]) + explicit constexpr ArrayRef(T (&array)[size]) : array_(array), size_(size) { } template <typename U, size_t size> - constexpr ArrayRef(U (&array)[size], - typename std::enable_if<std::is_same<T, const U>::value, tag>::type - t ATTRIBUTE_UNUSED = tag()) + explicit constexpr ArrayRef(U (&array)[size], + typename std::enable_if<std::is_same<T, const U>::value, tag>::type + t ATTRIBUTE_UNUSED = tag()) : array_(array), size_(size) { } @@ -83,9 +83,9 @@ class ArrayRef { } template <typename U, typename Alloc> - ArrayRef(const std::vector<U, Alloc>& v, - typename std::enable_if<std::is_same<T, const U>::value, tag>::type - t ATTRIBUTE_UNUSED = tag()) + 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()) : array_(v.data()), size_(v.size()) { } |