c++ Programming Glossary: is_base_of
How to partially specialize a class template for all derived types? http://stackoverflow.com/questions/1032973/how-to-partially-specialize-a-class-template-for-all-derived-types Derived struct hash typename boost enable_if std tr1 is_base_of CRTPBase Derived Derived Derived type size_t operator const..
Is it possible to detect namespace membership in C++? http://stackoverflow.com/questions/10657711/is-it-possible-to-detect-namespace-membership-in-c many useful compile time reflection capabilities. E.g. std is_base_of B D value determines at compile time whether B is a base class..
C++: How to require that one template type is derived from the other http://stackoverflow.com/questions/2631585/c-how-to-require-that-one-template-type-is-derived-from-the-other might look like this template typename B typename D struct is_base_of check if B is a base of D typedef char yes 1 typedef char no.. R2 bool operator Manager R1 m1 Manager R2 m2 STATIC_ASSERT is_base_of R1 R2 value is_base_of R2 R1 value return p1.internal_field.. R1 m1 Manager R2 m2 STATIC_ASSERT is_base_of R1 R2 value is_base_of R2 R1 value return p1.internal_field p2.internal_field If one..
How `is_base_of` works? http://stackoverflow.com/questions/2910979/how-is-base-of-works `is_base_of` works Why the following code works typedef char yes 1 typedef.. B const operator D template typename B typename D struct is_base_of template typename T static yes check D T static no check B int.. class Derived private Base Exspression is true. int test is_base_of Base Derived value is_base_of Derived Base value Note that B..
Integrate type name in static_assert output? http://stackoverflow.com/questions/6415186/integrate-type-name-in-static-assert-output message prog.cpp In instantiation of 'AssertValue std is_base_of IMyInterface MyBadType ' prog.cpp 37 69 instantiated from 'void.. of your check. For example if you were checking a std is_base_of it will print the full type of the check e.g. std is_base_of.. it will print the full type of the check e.g. std is_base_of IMyInterface MyBadType . Then you know exactly what types were..
C++ templates that accept only certain types http://stackoverflow.com/questions/874298/c-templates-that-accept-only-certain-types using Boost's static assert feature in concert with is_base_of from the Boost Type Traits library template typename T class.. typename T class ObservableList BOOST_STATIC_ASSERT is_base_of List T value Yes the double parentheses are needed otherwise..
|