Bug 1319016 - Part1 - Make IntegralConstant::value use constexpr. draft
authorJames Cheng <jacheng@mozilla.com>
Mon, 21 Nov 2016 14:27:58 +0800
changeset 441887 3a82b1b2e192eb8def0f46e958b63d3b9f7b0331
parent 441645 b7f895c1dc2e91530240efbf50ac063a0f8a9cb5
child 441888 26a5557d69657f164a82af03a082a5577e4467c8
push id36540
push userbmo:jacheng@mozilla.com
push dateMon, 21 Nov 2016 09:40:16 +0000
bugs1319016
milestone53.0a1
Bug 1319016 - Part1 - Make IntegralConstant::value use constexpr. MozReview-Commit-ID: DtrDeMC1f5T
mfbt/TypeTraits.h
--- a/mfbt/TypeTraits.h
+++ b/mfbt/TypeTraits.h
@@ -41,17 +41,17 @@ typename AddRvalueReference<T>::Type Dec
 
 /**
  * Helper class used as a base for various type traits, exposed publicly
  * because <type_traits> exposes it as well.
  */
 template<typename T, T Value>
 struct IntegralConstant
 {
-  static const T value = Value;
+  static constexpr T value = Value;
   typedef T ValueType;
   typedef IntegralConstant<T, Value> Type;
 };
 
 /** Convenient aliases. */
 typedef IntegralConstant<bool, true> TrueType;
 typedef IntegralConstant<bool, false> FalseType;