Bug 1493781 - Add a comment to IsBaseOf indicating that it is reflexive r=froydnj
authorAndrew McCreight <continuation@gmail.com>
Mon, 24 Sep 2018 19:58:16 +0000
changeset 437936 abff79205da29ce27f639310457007e69dcdb138
parent 437935 02370904a69681ffbc61b61ca4bc185a5be33022
child 437937 32d9dbdfae6b74ee1e1144fc65b8ab1029cb1eff
push id34707
push userebalazs@mozilla.com
push dateTue, 25 Sep 2018 09:18:36 +0000
treeherdermozilla-central@8db8a228536d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1493781
milestone64.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 1493781 - Add a comment to IsBaseOf indicating that it is reflexive r=froydnj IsBaseOf<A, A> holds despite the fact that a class is not actually a base class of itself. Differential Revision: https://phabricator.services.mozilla.com/D6694
mfbt/TypeTraits.h
--- a/mfbt/TypeTraits.h
+++ b/mfbt/TypeTraits.h
@@ -731,16 +731,17 @@ struct BaseOfTester<Type, const Type> : 
  * IsBaseOf allows to know whether a given class is derived from another.
  *
  * Consider the following class definitions:
  *
  *   class A {};
  *   class B : public A {};
  *   class C {};
  *
+ * mozilla::IsBaseOf<A, A>::value is true;
  * mozilla::IsBaseOf<A, B>::value is true;
  * mozilla::IsBaseOf<A, C>::value is false;
  */
 template<class Base, class Derived>
 struct IsBaseOf
   : IntegralConstant<bool, detail::BaseOfTester<Base, Derived>::value>
 {};