700. N1856 defines struct identity

Section: 22.2.4 [forward] Status: CD1 Submitter: P.J. Plauger Opened: 2007-07-01 Last modified: 2016-01-28 10:19:27 UTC

Priority: Not Prioritized

View all other issues in [forward].

View all issues with CD1 status.


N1856 defines struct identity in <utility> which clashes with the traditional definition of struct identity in <functional> (not standard, but a common extension from old STL). Be nice if we could avoid this name clash for backward compatibility.

Proposed resolution:

Change 22.2.4 [forward]:

template <class T> struct identity
    typedef T type;
    const T& operator()(const T& x) const;
const T& operator()(const T& x) const;

Returns: x.