Library of Assembled Shared Sources
lass::meta Namespace Reference

Detailed Description

library for template meta programming

This library (and namespace) contains tools for meta programming.

overview

This library obeys the grand rules of lass' code style. Types start with a capital, values don't. They do so regardless if the type is in fact a meta value, a meta type or a meta function. And that's a good thing. That way Bool, True, False, If, ... start with a capital so they can exists in peace next to bool, true, false, if ... .

meta-constants

meta-types

  • NullType: the i'm-not-a-type type.
  • TypeList: A meta container of types

meta-functions

The result of a meta function can be a type or a value. The former will be presented by a typedef called Type. The latter will be an enum called value. Again, style rules are obeyed: types start with a capital, values don't.

typedef typename AMetaFunctionReturningAType<Foo, Bar>::Type Type;
enum { value = AMetaFunctionReturningAValue<Fun, Spam>::value };
  • Bool: converts a bool value the the meta constants True and False.
  • If: executes one of two metafunctions based on the value of a compile time bool.
  • Int2Type: converts an integral value to a type.
  • IsConvertible: evaluates true if one type is convertible to another.
  • IsDerived: evaluates true if one type is derived from (or equal to) another.
  • IsDerivedTypeStruct: evaluates true if one type is derived from another and is not the same.
  • IsIntegral: evaluates true if a type is a standard integral type.
  • IsSame: evaluates true if two types are identical.
  • Select: selects one of two types based on a compile time bool.
  • Wrap: converts a type to a unique empty type.

@subscection traits

  • TypeTraits: compile time information and operations on a single type

macros

  • LASS_META_ASSERT: compile time assert
Note
Currently, this libary is headers only. This means no static library needs to be build. Hence, the meta project is skipped by the build and the automatic link to the lib is commented. [BdG]

Data Structures

struct  And
 meta AND More...
 
class  Bool
 meta boolean type More...
 
struct  False
 meta false More...
 
struct  If
 Evaluates meta expression TrueType or FalseType based on a meta condition Condition. More...
 
struct  Not
 meta NOT More...
 
struct  Or
 meta OR More...
 
struct  Select
 Select a type based on a meta condition that evaluates to meta::True or meta::False. More...
 
class  True
 meta true More...
 
class  TypeTraits
 Interesting goodies on types. More...
 
struct  Xor
 meta XOR More...