#include <Unit.h>
Public Types | |
typedef BSUtilities::IF< Loki::SuperSubclass< BU, TU >::value, TU, UnitError< true > >::RET | Check |
perform check |
check whether test unit TU is a descendant of base unit BU;
Definition at line 71 of file Unit.h.
|
perform check uses Alexandrescu's template SuperSubclass to detect inheritance at compile time, its value function returns a bool; uses Czarnecki and Eisenecker's template IF to select between two classes, depending on the outcome of SuperSubclass; UnitError<true> is never declared and can not be instantiated, it is selected if BU is not a base class of TU; if the compiler wants to instantiate UnitError<true> it emits an error message; if, on the other hand BU is a base class if TU, the test unit is instantiated ok and can be retrieved from Check. |