Type traits
The following are metafunctions related to vector expressions. They are not intended to be of use to the user and are included in the documentation only for posterity.
Note
Each metafunction has a corresponding _t
or _v
shorthand
-
template<class T>
struct type_identity Helper metafunction to return a template type unchanged.
Subclassed by traits::_scalar_impl< Expr >
-
template<bool Condition, class Ty = bool>
using traits::require = std::enable_if_t<Condition, Ty> Wrapper for
std::enable_if_t
with second parameter defaulted tobool
Renamed for brevity and to be closer to C++20 syntax
-
template<class T>
struct is_value : public traits::_is_value<T> Determines if a type is a vector value type.
-
template<class T>
struct is_operation : public traits::_is_operation<T> Determines if a type is a vector operation.
-
template<class T>
struct is_expression : public traits::_is_expression<T> Determines if a type is a vector expression.
Returns true iff a type is a value or an operation
-
template<class Expr>
struct scalar : public traits::_scalar<Expr> Gets the scalar type of a vector expression.
Values: returns scalar type of the value
Operations: returns the resulting scalar type of the operation
-
template<class Expr>
struct size : public traits::_size<Expr> Gets the size of a vector expression.
Values: returns size of the value
Operations: returns the greatest size of its operands
-
template<class Expr>
struct vector : public traits::_vector<Expr> Gets the resulting vector type of a vector expression @detail Behaviour undefined for non-expression types.
-
template<class T, class U>
struct is_same_size : public traits::_is_same_size<T, U, is_expression_v<T> && is_expression_v<U>> Determines if two types are vector expressions of the same size.
-
template<class L, class R, bool Strict_ordering>
struct is_valid_operation : public traits::_is_valid_operation<L, R, Strict_ordering> Determines if two types form a valid vector operation.
- param Strict_ordering
A value of true forbids a scalar type from appearing first in the operation