![]() |
Base template for the ElementsTrait class. More...
#include <ElementsTrait.h>
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. ElementsTrait defines the nested type Type, which represents the resulting data type of the elements operation. In case the given data type is not a dense or sparse vector type, the resulting data type Type is set to INVALID_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: