Bug 1506763: Mark [Enumerated]Array constructors as constexpr. r=froydnj
authorDavid Major <dmajor@mozilla.com>
Tue, 13 Nov 2018 12:34:45 -0500
changeset 446139 79148f9b36487274b734e30b48a18608e250cc99
parent 446138 86005ec774e68a1dd584fe4f9d642170641f20d8
child 446140 d8bb05d82665ddf5bb5b911bf6e0fcc4b2d8c72e
push id35035
push userccoroiu@mozilla.com
push dateWed, 14 Nov 2018 09:52:26 +0000
treeherdermozilla-central@073045259e75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1506763
milestone65.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 1506763: Mark [Enumerated]Array constructors as constexpr. r=froydnj
mfbt/Array.h
mfbt/EnumeratedArray.h
--- a/mfbt/Array.h
+++ b/mfbt/Array.h
@@ -22,17 +22,17 @@ template<typename T, size_t Length>
 class Array
 {
   T mArr[Length];
 
 public:
   Array() {}
 
   template <typename... Args>
-  MOZ_IMPLICIT Array(Args&&... aArgs)
+  MOZ_IMPLICIT constexpr Array(Args&&... aArgs)
     : mArr{std::forward<Args>(aArgs)...}
   {
     static_assert(sizeof...(aArgs) == Length,
                   "The number of arguments should be equal to the template parameter Length");
   }
 
   T& operator[](size_t aIndex)
   {
--- a/mfbt/EnumeratedArray.h
+++ b/mfbt/EnumeratedArray.h
@@ -50,17 +50,17 @@ private:
   typedef Array<ValueType, kSize> ArrayType;
 
   ArrayType mArray;
 
 public:
   EnumeratedArray() {}
 
   template <typename... Args>
-  MOZ_IMPLICIT EnumeratedArray(Args&&... aArgs)
+  MOZ_IMPLICIT constexpr EnumeratedArray(Args&&... aArgs)
     : mArray{std::forward<Args>(aArgs)...}
   {}
 
   explicit EnumeratedArray(const EnumeratedArray& aOther)
   {
     for (size_t i = 0; i < kSize; i++) {
       mArray[i] = aOther.mArray[i];
     }