Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Class template identity

boost::compute::identity

Synopsis

// In header: <boost/compute/functional/identity.hpp>

template<typename T> 
class identity {
public:
  // types
  typedef T result_type;  // Identity function result type. 

  // construct/copy/destruct
  identity();
};

Description

Identity function which simply returns its input.

For example, to directly copy values using the transform() algorithm:

transform(input.begin(), input.end(), output.begin(), identity<int>(), queue);

See Also:

as<T>, convert<T>

identity public construct/copy/destruct

  1. identity();
    Creates a new identity function.

PrevUpHomeNext