identity Structure

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

A struct that provides a type definition as the template parameter.

struct identity { typedef Type type; Type operator()(const Type& left) const; };

Parameters

ParameterDescription
leftThe value to identify.

The class contains the public type definition type, which is the same as the template parameter Type. It is used in conjunction with template function forward to ensure that a function parameter has the desired type.

For compatibility with older code, the class also defines the identity function operator() which returns its argument left.

Header: <utility>

Namespace: std

<utility>

Show: