Bug 819791 - Part 11: Make nsTArray and friends' copy constructors explicit. r=bz
authorJustin Lebar <justin.lebar@gmail.com>
Tue, 18 Dec 2012 20:16:07 -0500
changeset 125589 1dfb85987ee0
parent 125588 80ca371b52d5
child 125590 dc08a7e9993a
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs819791
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 819791 - Part 11: Make nsTArray and friends' copy constructors explicit. r=bz
xpcom/glue/nsTArray.h
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -1372,39 +1372,39 @@ class nsTArray : public nsTArray_Impl<E,
 {
 public:
   typedef nsTArray_Impl<E, nsTArrayInfallibleAllocator> base_type;
   typedef nsTArray<E>                                   self_type;
   typedef typename base_type::size_type                 size_type;
 
   nsTArray() {}
   explicit nsTArray(size_type capacity) : base_type(capacity) {}
-  nsTArray(const nsTArray& other) : base_type(other) {}
+  explicit nsTArray(const nsTArray& other) : base_type(other) {}
 
   template<class Allocator>
-  nsTArray(const nsTArray_Impl<E, Allocator>& other) : base_type(other) {}
+  explicit nsTArray(const nsTArray_Impl<E, Allocator>& other) : base_type(other) {}
 };
 
 //
 // FallibleTArray is a fallible vector class.
 //
 template <class E>
 class FallibleTArray : public nsTArray_Impl<E, nsTArrayFallibleAllocator>
 {
 public:
   typedef nsTArray_Impl<E, nsTArrayFallibleAllocator>   base_type;
   typedef FallibleTArray<E>                             self_type;
   typedef typename base_type::size_type                 size_type;
 
   FallibleTArray() {}
   explicit FallibleTArray(size_type capacity) : base_type(capacity) {}
-  FallibleTArray(const FallibleTArray<E>& other) : base_type(other) {}
+  explicit FallibleTArray(const FallibleTArray<E>& other) : base_type(other) {}
 
   template<class Allocator>
-  FallibleTArray(const nsTArray_Impl<E, Allocator>& other) : base_type(other) {}
+  explicit FallibleTArray(const nsTArray_Impl<E, Allocator>& other) : base_type(other) {}
 };
 
 //
 // nsAutoArrayBase is a base class for AutoFallibleTArray and nsAutoTArray.
 // You shouldn't use this class directly.
 //
 template <class TArrayBase, uint32_t N>
 class nsAutoArrayBase : public TArrayBase
@@ -1482,17 +1482,17 @@ class nsAutoTArray : public nsAutoArrayB
 {
   typedef nsAutoTArray<E, N> self_type;
   typedef nsAutoArrayBase<nsTArray<E>, N> Base;
 
 public:
   nsAutoTArray() {}
 
   template<typename Allocator>
-  nsAutoTArray(const nsTArray_Impl<E, Allocator>& other) {
+  explicit nsAutoTArray(const nsTArray_Impl<E, Allocator>& other) {
     Base::AppendElements(other);
   }
 
   operator const AutoFallibleTArray<E, N>&() const {
     return *reinterpret_cast<const AutoFallibleTArray<E, N>*>(this);
   }
 };
 
@@ -1505,17 +1505,17 @@ class AutoFallibleTArray : public nsAuto
 {
   typedef AutoFallibleTArray<E, N> self_type;
   typedef nsAutoArrayBase<FallibleTArray<E>, N> Base;
 
 public:
   AutoFallibleTArray() {}
 
   template<typename Allocator>
-  AutoFallibleTArray(const nsTArray_Impl<E, Allocator>& other) {
+  explicit AutoFallibleTArray(const nsTArray_Impl<E, Allocator>& other) {
     Base::AppendElements(other);
   }
 
   operator const nsAutoTArray<E, N>&() const {
     return *reinterpret_cast<const nsAutoTArray<E, N>*>(this);
   }
 };