![]() |
Base template for the DivTrait class. More...
#include <DivTrait.h>
Base template for the DivTrait class.
The DivTrait class template offers the possibility to select the resulting data type of a generic division operation between the two given types T1 and T2. DivTrait defines the nested type Type, which represents the resulting data type of the division. In case the two types T1 and T2 cannot be divided, a compilation error is created. Note that const
and volatile
qualifiers and reference modifiers are generally ignored.
Per default, DivTrait supports all built-in data types. Additionally, the Blaze library provides appropriate specializations for the following user-defined arithmetic types:
DivTrait is guaranteed to work for all data types that provide a division operator (i.e. operator/
). In order to add support for user-defined data types that either don't provide a division operator or whose division operator returns a proxy object instead of a concrete type (as it is for instance common in expression template libraries) it is possible to specialize the DivTrait template. The following example shows the according specialization for the division of a dynamic column vector by a double precision scalar value:
The following example demonstrates the use of the DivTrait template, where depending on the two given data types the resulting data type is selected: