![]() |
Base template for the CrossTrait class. More...
#include <CrossTrait.h>
Base template for the CrossTrait class.
The CrossTrait class template offers the possibility to select the resulting data type of a generic cross product operation between the two given types T1 and T2. CrossTrait defines the nested type Type, which represents the resulting data type of the cross product. In case T1 and T2 cannot be combined in a cross product, the resulting data type Type is set to INVALID_TYPE. Note that const and volatile qualifiers and reference modifiers are generally ignored.
Since the cross product is only defined for 3-dimensional vectors, the CrossTrait template only supports the following vector types:
It is possible to specialize the CrossTrait template for additional user-defined data types. The following example shows the according specialization for the cross product between two static column vectors:
The following example demonstrates the use of the CrossTrait template, where depending on the two given data types the resulting data type is selected: