Boost C++ Libraries

PrevUpHomeNext
identity
Header
Description
Semantics
Synopsis

identity

#include <boost/fit/identity.hpp>

Description

The identity function is an unary function object that returns whats given to it.

Semantics

assert(identity(x) == x);

Synopsis

struct
{
    template<class T>
    constexpr T operator()(T&& x) const
    {
        return boost::fit::forward<T>(x);
    }
} identity;