Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

unit::CheckUnit< BU, TU > Struct Template Reference

helper template CheckUnit More...

#include <Unit.h>

List of all members.

Public Types

typedef BSUtilities::IF< Loki::SuperSubclass<
BU, TU >::value, TU, UnitError<
true > >::RET 
Check
 perform check


Detailed Description

template<class BU, class TU>
struct unit::CheckUnit< BU, TU >

helper template CheckUnit

check whether test unit TU is a descendant of base unit BU;

Definition at line 71 of file Unit.h.


Member Typedef Documentation

template<class BU, class TU>
typedef BSUtilities::IF<Loki::SuperSubclass<BU, TU>::value, TU, UnitError<true> >::RET unit::CheckUnit< BU, TU >::Check
 

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.

Definition at line 86 of file Unit.h.


The documentation for this struct was generated from the following file:
Generated on Sun Jan 15 14:05:23 2006 for Quantity by doxygen 1.3.6