Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 921 Bytes

identity-structure.md

File metadata and controls

31 lines (23 loc) · 921 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: identity Structure
identity Structure
11/04/2016
utility/std::identity
identity class
identity structure
990756fd-7969-4b39-ad7e-0878e8dac8fd

identity Structure

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

Syntax

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

Parameters

left
The value to identify.

Remarks

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.