• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Class template identity</title>
5<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../index.html" title="Chapter 1. Boost.Compute">
8<link rel="up" href="../../boost_compute/reference.html#header.boost.compute.functional.identity_hpp" title="Header &lt;boost/compute/functional/identity.hpp&gt;">
9<link rel="prev" href="hash.html" title="Struct template hash">
10<link rel="next" href="binary_negate.html" title="Class template binary_negate">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="hash.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_compute/reference.html#header.boost.compute.functional.identity_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="binary_negate.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="refentry">
26<a name="boost.compute.identity"></a><div class="titlepage"></div>
27<div class="refnamediv">
28<h2><span class="refentrytitle">Class template identity</span></h2>
29<p>boost::compute::identity</p>
30</div>
31<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
32<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_compute/reference.html#header.boost.compute.functional.identity_hpp" title="Header &lt;boost/compute/functional/identity.hpp&gt;">boost/compute/functional/identity.hpp</a>&gt;
33
34</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
35<span class="keyword">class</span> <a class="link" href="identity.html" title="Class template identity">identity</a> <span class="special">{</span>
36<span class="keyword">public</span><span class="special">:</span>
37  <span class="comment">// types</span>
38  <span class="keyword">typedef</span> <span class="identifier">T</span> <a name="boost.compute.identity.result_type"></a><span class="identifier">result_type</span><span class="special">;</span>  <span class="comment">// Identity function result type. </span>
39
40  <span class="comment">// <a class="link" href="identity.html#boost.compute.identityconstruct-copy-destruct">construct/copy/destruct</a></span>
41  <a class="link" href="identity.html#idm45549385381952-bb"><span class="identifier">identity</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
42<span class="special">}</span><span class="special">;</span></pre></div>
43<div class="refsect1">
44<a name="idm45849510633200"></a><h2>Description</h2>
45<p>Identity function which simply returns its input.</p>
46<p>For example, to directly copy values using the transform() algorithm: </p>
47<pre class="programlisting"><span class="identifier">transform</span><span class="special">(</span><span class="identifier">input</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span><span class="special">,</span> <span class="identifier">input</span><span class="special">.</span><span class="identifier">end</span><span class="special">(</span><span class="special">)</span><span class="special">,</span> <span class="identifier">output</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span><span class="special">,</span> <span class="identifier">identity</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span><span class="special">(</span><span class="special">)</span><span class="special">,</span> <span class="identifier">queue</span><span class="special">)</span><span class="special">;</span>
48</pre>
49<p><span class="bold"><strong>See Also:</strong></span></p>
50<p><a class="link" href="as.html" title="Struct template as">as&lt;T&gt;</a>, <a class="link" href="convert.html" title="Struct template convert">convert&lt;T&gt;</a> </p>
51<p>
52</p>
53<p>
54</p>
55<div class="refsect2">
56<a name="idm45849510612128"></a><h3>
57<a name="boost.compute.identityconstruct-copy-destruct"></a><code class="computeroutput">identity</code>
58        public
59       construct/copy/destruct</h3>
60<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
61<pre class="literallayout"><a name="idm45549385381952-bb"></a><span class="identifier">identity</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Creates a new identity function. </li></ol></div>
62</div>
63</div>
64</div>
65<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
66<td align="left"></td>
67<td align="right"><div class="copyright-footer">Copyright © 2013, 2014 Kyle Lutz<p>
68        Distributed under the Boost Software License, Version 1.0. (See accompanying
69        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
70      </p>
71</div></td>
72</tr></table>
73<hr>
74<div class="spirit-nav">
75<a accesskey="p" href="hash.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_compute/reference.html#header.boost.compute.functional.identity_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="binary_negate.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
76</div>
77</body>
78</html>
79