Tags are empty types which can be used as a function argument. More...
Classes | |
struct | DiscreteSpace |
A Tag for EnumerationSpaces. It tells the Functions, that the space is discrete and can be enumerated. More... | |
struct | RealSpace |
A Tag for EnumerationSpaces. It tells the Functions, that the space is real and can't be enumerated. More... | |
Tags are empty types which can be used as a function argument.
A Tag enables the compiler to automatically choose the correct version of the function based on the tag. This is usefull to circumvent writing if-else cascades in multiple functions. Also it prevents the instantiation of unneeded code. It also enables the use of compile time errors when certain combination of tags must be prevented. This happens for example in the exact computation of the partition fucntion, which can't be evaluated for two real enumeration spaces. usage function(argument,SomeType::tag()); for a function defined as T function(U,tag_type);