blaze::BinaryMapTrait< T1, T2, OP > Struct Template Reference

Base template for the BinaryMapTrait class. More...

#include <BinaryMapTrait.h>

Detailed Description

template<typename T1, typename T2, typename OP>
struct blaze::BinaryMapTrait< T1, T2, OP >

Base template for the BinaryMapTrait class.

General

The BinaryMapTrait class template offers the possibility to select the resulting data type of a generic, binary map operation between the two given types T1 and T2. BinaryMapTrait defines the nested type Type, which represents the resulting data type of the map operation. In case no result type can be determined for the two types T1 and T2, a compilation error is created. Note that const and volatile qualifiers and reference modifiers are generally ignored.

Per default, BinaryMapTrait supports all built-in data types. Additionally, the Blaze library provides appropriate specializations for the following user-defined arithmetic types:


Creating custom specializations

BinaryMapTrait is guaranteed to work for all data types that work in combination with the provided custom operation OP. In order to add support for user-defined data types or in order to adapt to special cases it is possible to specialize the BinaryMapTrait template. The following example shows the according specialization for binary map operations between two dynamic column vectors:

template< typename T1, typename T2, typename OP >
struct BinaryMapTrait< DynamicVector<T1,columnVector>, DynamicVector<T2,columnVector>, OP >
{
using Type = DynamicVector< typename BinaryMapTrait<T1,T2,OP>::Type, columnVector >;
};

The documentation for this struct was generated from the following file: