#include <Unit.h>
Public Types | |
typedef BSUtilities::IF< Loki::SuperSubclass< BU, U >::value, UnitError< false >, UnitError< true > >::RET::RET | Check |
perform check |
check whether unit U is a descendant of base unit BU;
Definition at line 114 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 U; if the compiler wants to instantiate UnitError<true> it emits an error message, if BU is a base class if U, UnitError<false> is instantiated ok. |