Jive reference manual
List of all members | Static Public Attributes
jem::BoolType< TruthValue > Class Template Reference

Provides support for writing meta-programs. More...

#include <jem/base/utilities.h>

Static Public Attributes

static const bool VALUE = TruthValue
 The truth value of this BoolType class. More...
 

Detailed Description

template<bool TruthValue>
class jem::BoolType< TruthValue >

The template class BoolType can be used to write `meta-programs' that are run during the compilation of a program. The boolean template parameter TruthValue should be an expression that evaluates to either true or false at compile-time.

Here is an example:

inline void compute ( BoolType<true> )
{
computeWithTinyInts ();
}
inline void compute ( BoolType<false> )
{
computeWithLongInts ();
}
inline void compute ()
{
compute ( BoolType<(sizeof(int) < 4)>() );
}

Member Data Documentation

template<bool TruthValue>
const bool jem::BoolType< TruthValue >::VALUE = TruthValue
static

A static boolean that equals the truth value of this BoolType class.