![]() |
Base template for the SubvectorTrait class. More...
#include <SubvectorTrait.h>
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. SubvectorTrait defines the nested type Type, which represents the resulting data type of the subvector 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, the SubvectorTrait template only supports the following vector types:
It is possible to specialize the SubvectorTrait template for additional user-defined vector types. 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: