![]() |
Blaze 3.9
|
Base template for the ElementsTrait class. More...
#include <ElementsTrait.h>
Inherits decltype evalElementsTrait std::declval< VT & >.
Base template for the ElementsTrait class.
The ElementsTrait class template offers the possibility to select the resulting data type when selecting elements from a dense or sparse vector. In case the given type VT is a dense or sparse vector type, ElementsTrait defines the nested type Type, which represents the resulting data type of the elements operation. Otherwise there is no nested type Type. Note that const and volatile qualifiers and reference modifiers are generally ignored.
Per default, ElementsTrait supports all vector types of the Blaze library (including views and adaptors). For all other data types it is possible to specialize the ElementsTrait template. The following example shows the according specialization for the DynamicVector class template:
The following example demonstrates the use of the ElementsTrait template, where depending on the given vector type the according result type is selected: