Blaze 3.9
Loading...
Searching...
No Matches
Meta-Programming Language

Classes

struct  blaze::Bools<... >
 Auxiliary tool for unwrapping a pack of variadic boolean values. More...
struct  blaze::If< Condition >
 Compile time type selection. More...

Typedefs

template<typename T1, typename T2, typename... Ts>
using blaze::And_t
 Compile time logical AND evaluation.
template<typename T1, typename T2>
using blaze::Equal_t = Bool_t< ( T1::value == T2::value ) >
 Compile time type comparison.
template<typename T1, typename T2>
using blaze::Greater_t = Bool_t< ( T1::value > T2::value ) >
 Compile time type comparison.
template<typename T1, typename T2>
using blaze::Less_t = Bool_t< ( T1::value < T2::value ) >
 Compile time type comparison.
template<typename T1, typename T2>
using blaze::Max_t = If_t< Less_t<T1,T2>::value, T2, T1 >
 Compile time value evaluation.
template<typename T1, typename T2>
using blaze::Min_t = If_t< Less_t<T1,T2>::value, T1, T2 >
 Compile time value evaluation.
template<typename T1, typename T2>
using blaze::Minus_t
 Compile time integral subtraction.
template<typename T1, typename T2>
using blaze::Modulo_t
 Compile time integral modulo operation.
template<typename T1, typename T2, typename... Ts>
using blaze::Nand_t
 Compile time logical NAND evaluation.
template<typename T1, typename T2, typename... Ts>
using blaze::Nor_t
 Compile time logical 'not or' evaluation.
template<typename C>
using blaze::Not_t = Bool_t< !C::value >
 Compile time type negation.
template<typename T1, typename T2, typename... Ts>
using blaze::Or_t
 Compile time logical OR evaluation.
template<typename T1, typename T2>
using blaze::Plus_t
 Compile time integral addition.
template<typename T1, typename T2>
using blaze::Times_t
 Compile time integral multiplication.
template<typename T1, typename T2>
using blaze::Xor_t = Bool_t< ( T1::value ^ T2::value ) >
 Compile time bitwise XOR evaluation.

Variables

template<typename T1, typename T2, typename... Ts>
constexpr bool blaze::And_v = And_t<T1,T2,Ts...>::value
 Auxiliary variable template for the And_t alias.
template<typename T1, typename T2>
constexpr bool blaze::Equal_v = Equal_t<T1,T2>::value
 Auxiliary variable template for the Equal_t alias.
template<typename T1, typename T2>
constexpr bool blaze::Greater_v = Greater_t<T1,T2>::value
 Auxiliary variable template for the Greater_t alias.
template<typename T1, typename T2>
constexpr bool blaze::Less_v = Less_t<T1,T2>::value
 Auxiliary variable template for the Less_t alias.
template<typename T1, typename T2, typename... Ts>
constexpr bool blaze::Nand_v = Nand_t<T1,T2,Ts...>::value
 Auxiliary variable template for the Nand_t alias.
template<typename T1, typename T2, typename... Ts>
constexpr bool blaze::Nor_v = Nor_t<T1,T2,Ts...>::value
 Auxiliary variable template for the Nor_t alias.
template<typename C>
constexpr bool blaze::Not_v = Not_t<C>::value
 Auxiliary variable template for the Not_t alias.
template<typename T1, typename T2, typename... Ts>
constexpr bool blaze::Or_v = Or_t<T1,T2,Ts...>::value
 Auxiliary variable template for the Or_t alias.
template<typename T1, typename T2>
constexpr bool blaze::Xor_v = Xor_t<T1,T2>::value
 Auxiliary variable template for the Xor_t alias.

Detailed Description

Typedef Documentation

◆ And_t

template<typename T1, typename T2, typename... Ts>
using blaze::And_t
Initial value:
Bool_t< IsSame< Bools< true, T1::value, T2::value, (Ts::value)... >
, Bools< T1::value, T2::value, (Ts::value)..., true > >::value >
IntegralConstant< bool, B > Bool_t
Compile time integral constant wrapper for bool.
Definition IntegralConstant.h:153
Auxiliary tool for unwrapping a pack of variadic boolean values.
Definition Bools.h:56
Type relationship analysis.
Definition IsSame.h:141

Compile time logical AND evaluation.

The And_t alias template performs at compile time a logical AND ('&&') evaluation of at least two compile time conditions:

using namespace blaze;
using Type = int;
And_t< IsIntegral<Type>, IsSigned<Type> >::value // Evaluates to 1
And_t< IsFloat<Type> , IsDouble<Type> >::value // Evaluates to 0
Bool_t< IsSame< Bools< true, T1::value, T2::value,(Ts::value)... >, Bools< T1::value, T2::value,(Ts::value)..., true > >::value > And_t
Compile time logical AND evaluation.
Definition And.h:76
Compile time check for double precision floating point types.
Definition IsDouble.h:76
Compile time check for floating point data types.
Definition IsFloatingPoint.h:77
Compile time check for signed data types.
Definition IsSigned.h:79

◆ Equal_t

template<typename T1, typename T2>
using blaze::Equal_t = Bool_t< ( T1::value == T2::value ) >

Compile time type comparison.

The Equal_t alias template compares the two given types using the equality operator ('=='). In case T1::value is equal to T2::value, the nested value member is set to true. Otherwise it is set to false.

using namespace blaze;
Equal_t< Int_t<3>, Int_t<3> >::value // Evaluates to true
Equal_t< Int_t<5>, Long_t<5> >::value // Evaluates to true
Equal_t< Long_t<0>, Int_t<4> >::value // Evaluates to false
Bool_t<(T1::value==T2::value) > Equal_t
Compile time type comparison.
Definition Equal.h:73
IntegralConstant< int, N > Int_t
Compile time integral constant wrapper for int.
Definition IntegralConstant.h:195
IntegralConstant< long, N > Long_t
Compile time integral constant wrapper for long.
Definition IntegralConstant.h:216

◆ Greater_t

template<typename T1, typename T2>
using blaze::Greater_t = Bool_t< ( T1::value > T2::value ) >

Compile time type comparison.

The Greater_t alias template compares the two given types using the greater-than operator ('>'). In case T1::value is greater than T2::value, the nested value member is set to 1. Otherwise it is set to 0.

using namespace blaze;
Greater_t< Int_t<5> , Int_t<2> >::value // Evaluates to true
Greater_t< Int_t<5> , Long_t<2> >::value // Evaluates to true
Greater_t< Long_t<2>, Int_t<2> >::value // Evaluates to false
Greater_t< Int_t<2> , Long_t<5> >::value // Evaluates to false
Greater_t< Int_t<5> , Int_t<2> >::ValueType // Results in bool
Bool_t<(T1::value > T2::value) > Greater_t
Compile time type comparison.
Definition Greater.h:74

◆ Less_t

template<typename T1, typename T2>
using blaze::Less_t = Bool_t< ( T1::value < T2::value ) >

Compile time type comparison.

The Less_t alias template compares the two given types using the less-than operator ('<'). In case T1::value is less than T2::value, the nested value member is set to 1. Otherwise it is set to 0.

using namespace blaze;
Less_t< Int_t<2> , Int_t<5> >::value // Evaluates to true
Less_t< Long_t<2>, Int_t<5> >::value // Evaluates to true
Less_t< Int_t<2> , Long_t<2> >::value // Evaluates to false
Less_t< Long_t<5>, Int_t<2> >::value // Evaluates to false
Less_t< Int_t<2>, Int_t<5> >::ValueType // Results in bool
Bool_t<(T1::value< T2::value) > Less_t
Compile time type comparison.
Definition Less.h:74

◆ Max_t

template<typename T1, typename T2>
using blaze::Max_t = If_t< Less_t<T1,T2>::value, T2, T1 >

Compile time value evaluation.

The Max_t alias template selects the larger of the two given template arguments T1 and T2. In order for Max_t to be able to determine the larger type, both arguments are required to have a nested member value. The result of the minimum operation can be accessed via the nested member value, the resulting type is available via the nested type ValueType.

blaze::Max_t< Int_t<3> , Int_t<2> >::value // Results in 3
blaze::Max_t< Long_t<3>, Int_t<2> >::ValueType // Results in long
blaze::Max_t< Int_t<3> , Long_t<2> >::ValueType // Results in int
If_t< Less_t< T1, T2 >::value, T2, T1 > Max_t
Compile time value evaluation.
Definition Max.h:73

◆ Min_t

template<typename T1, typename T2>
using blaze::Min_t = If_t< Less_t<T1,T2>::value, T1, T2 >

Compile time value evaluation.

The Min_t alias template selects the smaller of the two given template arguments T1 and T2. In order for Min_t to be able to determine the smaller type, both arguments are required to have a nested member value. The result of the minimum operation can be accessed via the nested member value, the resulting type is available via the nested type ValueType.

blaze::Min_t< Int_t<3> , Int_t<2> >::value // Results in 2
blaze::Min_t< Long_t<3>, Int_t<2> >::ValueType // Results in int
blaze::Min_t< Int_t<3> , Long_t<2> >::ValueType // Results in long
If_t< Less_t< T1, T2 >::value, T1, T2 > Min_t
Compile time value evaluation.
Definition Min.h:73

◆ Minus_t

template<typename T1, typename T2>
using blaze::Minus_t
Initial value:
, ( T1::value - T2::value ) >
Generic wrapper for a compile time constant integral value.
Definition IntegralConstant.h:74

Compile time integral subtraction.

The Minus_t alias template returns the difference of the two given template arguments T1 and T2. In order for Minus_t to be able to subtract the two types, both arguments are required to have a nested member value. The result of the subtraction can be accessed via the nested member value, the resulting type is available via the nested type ValueType.

blaze::Minus_t< Int_t<3> , Int_t<2> >::value // Results in 5
blaze::Minus_t< Long_t<3>, Int_t<2> >::ValueType // Results in long
blaze::Minus_t< Int_t<3> , Long_t<2> >::ValueType // Results in long
IntegralConstant< CommonType_t< typename T1::ValueType, typename T2::ValueType >,(T1::value - T2::value) > Minus_t
Compile time integral subtraction.
Definition Minus.h:73

◆ Modulo_t

template<typename T1, typename T2>
using blaze::Modulo_t
Initial value:

Compile time integral modulo operation.

The Modulo_t alias template returns the result of a modulo operation between the two given template arguments T1 and T2. In order for Modulo_t to be able to perform the operation with the given two types, both arguments are required to have a nested member value. The result of the modulo operation can be accessed via the nested member value, the resulting type is available via the nested type ValueType.

blaze::Modulo_t< Int_t<3> , Int_t<2> >::value // Results in 1
blaze::Modulo_t< Long_t<3>, Int_t<2> >::ValueType // Results in long
blaze::Modulo_t< Int_t<3> , Long_t<2> >::ValueType // Results in long
IntegralConstant< CommonType_t< typename T1::ValueType, typename T2::ValueType >,(T1::value % T2::value) > Modulo_t
Compile time integral modulo operation.
Definition Modulo.h:73

◆ Nand_t

template<typename T1, typename T2, typename... Ts>
using blaze::Nand_t
Initial value:
Bool_t< !IsSame< Bools< true, T1::value, T2::value, (Ts::value)... >
, Bools< T1::value, T2::value, (Ts::value)..., true > >::value >

Compile time logical NAND evaluation.

The Nand_t alias template performs at compile time a logical NAND evaluation of at least two compile time conditions:

using namespace blaze;
using Type = int;
Nand_t< IsFloat<Type> , IsDouble<Type> >::value // Evaluates to 1
Nand_t< IsIntegral<Type>, IsSigned<Type> >::value // Evaluates to 0
Bool_t< !IsSame< Bools< true, T1::value, T2::value,(Ts::value)... >, Bools< T1::value, T2::value,(Ts::value)..., true > >::value > Nand_t
Compile time logical NAND evaluation.
Definition Nand.h:76

◆ Nor_t

template<typename T1, typename T2, typename... Ts>
using blaze::Nor_t
Initial value:
Bool_t< IsSame< Bools< false, T1::value, T2::value, (Ts::value)... >
, Bools< T1::value, T2::value, (Ts::value)..., false > >::value >

Compile time logical 'not or' evaluation.

The Nor_t alias template performs at compile time a logical 'not or' evaluation of at least two compile time conditions:

using namespace blaze;
using Type = int;
Nor_t< IsFloat<Type> , IsDouble<Type> >::value // Evaluates to 1
Nor_t< IsIntegral<Type>, IsSigned<Type> >::value // Evaluates to 0
Bool_t< IsSame< Bools< false, T1::value, T2::value,(Ts::value)... >, Bools< T1::value, T2::value,(Ts::value)..., false > >::value > Nor_t
Compile time logical 'not or' evaluation.
Definition Nor.h:76

◆ Not_t

template<typename C>
using blaze::Not_t = Bool_t< !C::value >

Compile time type negation.

The Not_t alias template negates the given compile time condition. In case the given condition would evaluate to true, the nested member enumeration is set to false and vice versa:

using namespace blaze;
Not_t< IsIntegral<int> >::value // Evaluates to false
Not_t< IsDouble<int> >::value // Evaluates to true
Not_t< IsSigned<int> >::ValueType // Results in bool
Bool_t< !C::value > Not_t
Compile time type negation.
Definition Not.h:70

◆ Or_t

template<typename T1, typename T2, typename... Ts>
using blaze::Or_t
Initial value:
Bool_t< !IsSame< Bools< false, T1::value, T2::value, (Ts::value)... >
, Bools< T1::value, T2::value, (Ts::value)..., false > >::value >

Compile time logical OR evaluation.

The Or_t alias template performs at compile time a logical OR ('||') evaluation of at least two compile time conditions:

using namespace blaze;
using Type = int;
Or_t< IsIntegral<Type>, IsSigned<Type> >::value // Evaluates to 1
Or_t< IsIntegral<Type>, IsFloatingPoint<Type> >::value // Evaluates to 1
Or_t< IsFloat<Type> , IsDouble<Type> >::value // Evaluates to 0
Bool_t< !IsSame< Bools< false, T1::value, T2::value,(Ts::value)... >, Bools< T1::value, T2::value,(Ts::value)..., false > >::value > Or_t
Compile time logical OR evaluation.
Definition Or.h:76

◆ Plus_t

template<typename T1, typename T2>
using blaze::Plus_t
Initial value:

Compile time integral addition.

The Plus_t alias template returns the sum of the two given template arguments T1 and T2. In order for Plus_t to be able to add the two types, both arguments are required to have a nested member value. The result of the addition can be accessed via the nested member value, the resulting type is available via the nested type ValueType.

blaze::Plus_t< Int_t<3> , Int_t<2> >::value // Results in 5
blaze::Plus_t< Long_t<3>, Int_t<2> >::ValueType // Results in long
blaze::Plus_t< Int_t<3> , Long_t<2> >::ValueType // Results in long
IntegralConstant< CommonType_t< typename T1::ValueType, typename T2::ValueType >,(T1::value+T2::value) > Plus_t
Compile time integral addition.
Definition Plus.h:72

◆ Times_t

template<typename T1, typename T2>
using blaze::Times_t
Initial value:

Compile time integral multiplication.

The Times_t alias template returns the product of the two given template arguments T1 and T2. In order for Times_t to be able to multiply the two types, both arguments are required to have a nested member value. The result of the multiplication can be accessed via the nested member value, the resulting type is available via the nested type ValueType.

blaze::Times_t< Int_t<3> , Int_t<2> >::value // Results in 6
blaze::Times_t< Long_t<3>, Int_t<2> >::ValueType // Results in long
blaze::Times_t< Int_t<3> , Long_t<2> >::ValueType // Results in long
IntegralConstant< CommonType_t< typename T1::ValueType, typename T2::ValueType >,(T1::value *T2::value) > Times_t
Compile time integral multiplication.
Definition Times.h:72

◆ Xor_t

template<typename T1, typename T2>
using blaze::Xor_t = Bool_t< ( T1::value ^ T2::value ) >

Compile time bitwise XOR evaluation.

The Xor_t alias template performs at compile time a bitwise XOR evaluation of the two given compile time conditions:

using namespace blaze;
using Type = int;
Xor_t< IsSigned<Type> , IsUnsigned<Type> >::value // Evaluates to 1
Xor_t< IsSigned<Type> , IsIntegral<Type> >::value // Evaluates to 0
Bool_t<(T1::value ^ T2::value) > Xor_t
Compile time bitwise XOR evaluation.
Definition Xor.h:74
Compile time check for integral data types.
Definition IsIntegral.h:77
Compile time check for unsigned data types.
Definition IsUnsigned.h:79

Variable Documentation

◆ And_v

template<typename T1, typename T2, typename... Ts>
bool blaze::And_v = And_t<T1,T2,Ts...>::value
constexpr

Auxiliary variable template for the And_t alias.

The And_v variable template provides a convenient shortcut to access the nested value of the And_t alias. For instance, given the types T1 and T2 the following two statements are identical:

constexpr bool value1 = And_t<T1,T2>::value;
constexpr bool value2 = And_v<T1,T2>;
constexpr bool And_v
Auxiliary variable template for the And_t alias.
Definition And.h:98

◆ Equal_v

template<typename T1, typename T2>
bool blaze::Equal_v = Equal_t<T1,T2>::value
constexpr

Auxiliary variable template for the Equal_t alias.

The Equal_v variable template provides a convenient shortcut to access the nested value of the Equal_t alias. For instance, given the types T1 and T2 the following two statements are identical:

constexpr bool value1 = Equal_t<T1,T2>::value;
constexpr bool value2 = Equal_v<T1,T2>;
constexpr bool Equal_v
Auxiliary variable template for the Equal_t alias.
Definition Equal.h:92

◆ Greater_v

template<typename T1, typename T2>
bool blaze::Greater_v = Greater_t<T1,T2>::value
constexpr

Auxiliary variable template for the Greater_t alias.

The Greater_v variable template provides a convenient shortcut to access the nested value of the Greater_t alias. For instance, given the types T1 and T2 the following two statements are identical:

constexpr bool value1 = Greater_t<T1,T2>::value;
constexpr bool value2 = Greater_v<T1,T2>;
constexpr bool Greater_v
Auxiliary variable template for the Greater_t alias.
Definition Greater.h:93

◆ Less_v

template<typename T1, typename T2>
bool blaze::Less_v = Less_t<T1,T2>::value
constexpr

Auxiliary variable template for the Less_t alias.

The Less_v variable template provides a convenient shortcut to access the nested value of the Less_t alias. For instance, given the types T1 and T2 the following two statements are identical:

constexpr bool value1 = Less_t<T1,T2>::value;
constexpr bool value2 = Less_v<T1,T2>;
constexpr bool Less_v
Auxiliary variable template for the Less_t alias.
Definition Less.h:93

◆ Nand_v

template<typename T1, typename T2, typename... Ts>
bool blaze::Nand_v = Nand_t<T1,T2,Ts...>::value
constexpr

Auxiliary variable template for the Nand_t alias.

The Nand_v variable template provides a convenient shortcut to access the nested value of the Nand_t alias. For instance, given the types T1 and T2 the following two statements are identical:

constexpr bool value1 = Nand_t<T1,T2>::value;
constexpr bool value2 = Nand_v<T1,T2>;
constexpr bool Nand_v
Auxiliary variable template for the Nand_t alias.
Definition Nand.h:98

◆ Nor_v

template<typename T1, typename T2, typename... Ts>
bool blaze::Nor_v = Nor_t<T1,T2,Ts...>::value
constexpr

Auxiliary variable template for the Nor_t alias.

The Nor_v variable template provides a convenient shortcut to access the nested value of the Nor_t alias. For instance, given the types T1 and T2 the following two statements are identical:

constexpr bool value1 = Nor_t<T1,T2>::value;
constexpr bool value2 = Nor_v<T1,T2>;
constexpr bool Nor_v
Auxiliary variable template for the Nor_t alias.
Definition Nor.h:98

◆ Not_v

template<typename C>
bool blaze::Not_v = Not_t<C>::value
constexpr

Auxiliary variable template for the Not_t alias.

The Not_v variable template provides a convenient shortcut to access the nested value of the Not_t alias. For instance, given the type C the following two statements are identical:

constexpr bool value1 = Not_t<C>::value;
constexpr bool value2 = Not_v<C>;
constexpr bool Not_v
Auxiliary variable template for the Not_t alias.
Definition Not.h:87

◆ Or_v

template<typename T1, typename T2, typename... Ts>
bool blaze::Or_v = Or_t<T1,T2,Ts...>::value
constexpr

Auxiliary variable template for the Or_t alias.

The Or_v variable template provides a convenient shortcut to access the nested value of the Or_t alias. For instance, given the types T1 and T2 the following two statements are identical:

constexpr bool value1 = Or_t<T1,T2>::value;
constexpr bool value2 = Or_t_v<T1,T2>;

◆ Xor_v

template<typename T1, typename T2>
bool blaze::Xor_v = Xor_t<T1,T2>::value
constexpr

Auxiliary variable template for the Xor_t alias.

The Xor_v variable template provides a convenient shortcut to access the nested value of the Xor_t alias. For instance, given the types T1 and T2 the following two statements are identical:

constexpr bool value1 = Xor_t<T1,T2>::value;
constexpr bool value2 = Xor_v<T1,T2>;
constexpr bool Xor_v
Auxiliary variable template for the Xor_t alias.
Definition Xor.h:93