c++-gtk-utils
|
Class for compile time testing of inheritance relationships. More...
#include <c++-gtk-utils/do_if.h>
Static Public Attributes | |
static const bool | value |
Class for compile time testing of inheritance relationships.
This class provides a compile time test of whether the Obj class template parameter type is related to the Base class template parameter type by public derivation, or they are of the same type: the 'value' public member will be true if they are, otherwise false. Everything in it comprises a compile time constant so that 'value' can be used as a template parameter for conditional complation, and can also be used with the std::enable_if template.
This class tests convertibility, and constness is not discarded in making the test. Whilst a non-const type passed as the second template parameter will (if the other conditions referred to above are met) be shown as related to a const base type or const same type specified as the first template parameter type, the reverse is not true. This ensures that the DoIf::mem_fun() and DoIf::fun() conditional compilation functions work correctly.
|
static |
A compile time constant which indicates whether the Obj class template parameter type is related to the Base class template parameter type by public derivation, or they are of the same type. Because it is a compile time constant it can be used as a template parameter and therefore for conditional compilation.
This constant specifies convertibility, and constness is not discarded in making the test. Whilst a non-const type passed as the second template parameter will (if the other conditions referred to above are met) be shown as related to a const base type or const same type specified as the first template parameter type, the reverse is not true. This ensures that the DoIf::mem_fun() and DoIf::fun() conditional compilation functions work correctly.