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

Units::CheckUnit< BU, U > Struct Template Reference

helper template CheckUnit More...

#include <Unit.h>

List of all members.

Public Types

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


Detailed Description

template<class BU, class U>
struct Units::CheckUnit< BU, U >

helper template CheckUnit

check whether unit U is a descendant of base unit BU;

Definition at line 114 of file Unit.h.


Member Typedef Documentation

template<class BU, class U>
typedef BSUtilities::IF<Loki::SuperSubclass<BU, U>::value, UnitError<false>, UnitError<true> >::RET::RET Units::CheckUnit< BU, U >::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 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.

Definition at line 128 of file Unit.h.


The documentation for this struct was generated from the following file:
Generated on Sun Jan 15 13:58:01 2006 for Quantity by doxygen 1.3.6