library of assembled shared sources

http://lass.cocamware.com

lass::meta::If< Condition, TrueType, FalseType > Struct Template Reference

Evaluates meta expression TrueType or FalseType based on a meta condition Condition. More...

#include <if.h>

Inheritance diagram for lass::meta::If< Condition, TrueType, FalseType >:

Inheritance graph
[legend]

Detailed Description

template<typename Condition, typename TrueType, typename FalseType>
struct lass::meta::If< Condition, TrueType, FalseType >

Evaluates meta expression TrueType or FalseType based on a meta condition Condition.

Depending on whether Condition is meta::True or meta::False, meta::If derives from TrueType or FalseType, thereby selecting the meta code path.

meta::If can roughly be expressed as meta::Select if only the resulting Type is needed.

    If<Cond, A, B>::Type <-> Select<Cond, A::Type, B::Type>::Type

Apart from being the shorter expression, using meta::If has the following benefits:

meta::If however cannot be used with fundamental types as you need to be able to derive from the result. This is not really a short coming, as meta::If is designed to select meta code paths, and not to select a type. Use meta::Select instead.

Definition at line 83 of file if.h.


The documentation for this struct was generated from the following file:

Generated on Mon Nov 10 14:22:09 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo