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