Move IsLvalueReference to the correct place, slightly beef up its documentation. No bug, r=trivial
authorJeff Walden <jwalden@mit.edu>
Wed, 20 Nov 2013 14:37:14 -0800
changeset 159592 add0171e4e490dc1a4c579ef25fcde26e27fe472
parent 159591 6882f119dcb13abcfe9294c91a8d35b98a39ff07
child 159593 48bf99549c118b6fe49df58db6b91ffd40291fc0
push id37358
push userjwalden@mit.edu
push dateMon, 09 Dec 2013 23:21:55 +0000
treeherdermozilla-inbound@3d9a20acba5d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstrivial
milestone29.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
Move IsLvalueReference to the correct place, slightly beef up its documentation. No bug, r=trivial
mfbt/TypeTraits.h
--- a/mfbt/TypeTraits.h
+++ b/mfbt/TypeTraits.h
@@ -125,16 +125,33 @@ struct IsFloatingPoint
  * mozilla::IsPointer<struct S>::value is false.
  */
 template<typename T>
 struct IsPointer : FalseType {};
 
 template<typename T>
 struct IsPointer<T*> : TrueType {};
 
+/**
+ * IsLvalueReference determines whether a type is an lvalue reference.
+ *
+ * mozilla::IsLvalueReference<struct S*>::value is false;
+ * mozilla::IsLvalueReference<int**>::value is false;
+ * mozilla::IsLvalueReference<void (*)(void)>::value is false;
+ * mozilla::IsLvalueReference<int>::value is false;
+ * mozilla::IsLvalueReference<struct S>::value is false;
+ * mozilla::IsLvalueReference<struct S*&>::value is true;
+ * mozilla::IsLvalueReference<struct S&&>::value is false.
+ */
+template<typename T>
+struct IsLvalueReference : FalseType {};
+
+template<typename T>
+struct IsLvalueReference<T&> : TrueType {};
+
 namespace detail {
 
 // __is_enum is a supported extension across all of our supported compilers.
 template<typename T>
 struct IsEnumHelper
   : IntegralConstant<bool, __is_enum(T)>
 {};
 
@@ -419,26 +436,16 @@ struct ConvertibleTester
  * are related through private inheritance, and you'll get a compile error if
  * you try.  Just don't do it!
  */
 template<typename From, typename To>
 struct IsConvertible
   : IntegralConstant<bool, detail::ConvertibleTester<From, To>::value>
 {};
 
-/**
- * Is IsLvalueReference<T> is true if its template param is T& and is false if
- * its type is T or T&&.
- */
-template<typename T>
-struct IsLvalueReference : FalseType {};
-
-template<typename T>
-struct IsLvalueReference<T&> : TrueType {};
-
 /* 20.9.7 Transformations between types [meta.trans] */
 
 /* 20.9.7.1 Const-volatile modifications [meta.trans.cv] */
 
 /**
  * RemoveConst removes top-level const qualifications on a type.
  *
  * mozilla::RemoveConst<int>::Type is int;