Ocean
Ocean::Identity< T > Class Template Reference

This class implements a helper class allowing to define the identity data type of a given type. More...

Public Types

using Type = T
 The data type of 'T'. More...
 

Detailed Description

template<typename T>
class Ocean::Identity< T >

This class implements a helper class allowing to define the identity data type of a given type.

The class can be used if e.g., to prevent that the compiler is able to implicitly determine a template data type in a function.

The following code example explains the usage of the helper class:

template <typename T>
void functionA(T value)
{
// do something
}
template <typename T>
void functionB(typename Identity<T>::Type value)
{
// do something
}
void main()
{
functionA(1); // will compile
functionB(1); // will not compile, e.g., with error message 'void Ocean::functionB(Identity<T>::Type)': could not deduce template argument for 'T'
functionB<double>(1); // will compile
}
T Type
The data type of 'T'.
Definition: DataType.h:90
Template Parameters
TThe data type to be used

Member Typedef Documentation

◆ Type

template<typename T >
using Ocean::Identity< T >::Type = T

The data type of 'T'.


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