• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Function template make_counting_iterator</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.iterator.counting_iterator_hpp" title="Header &lt;boost/compute/iterator/counting_iterator.hpp&gt;">
9<link rel="prev" href="counting_iterator.html" title="Class template counting_iterator">
10<link rel="next" href="discard_iterator.html" title="Class discard_iterator">
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="counting_iterator.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_compute/reference.html#header.boost.compute.iterator.counting_iterator_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="discard_iterator.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="refentry">
26<a name="boost.compute.make_counting_iterator"></a><div class="titlepage"></div>
27<div class="refnamediv">
28<h2><span class="refentrytitle">Function template make_counting_iterator</span></h2>
29<p>boost::compute::make_counting_iterator</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.iterator.counting_iterator_hpp" title="Header &lt;boost/compute/iterator/counting_iterator.hpp&gt;">boost/compute/iterator/counting_iterator.hpp</a>&gt;
33
34</span>
35<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span>
36  <a class="link" href="counting_iterator.html" title="Class template counting_iterator">counting_iterator</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="identifier">make_counting_iterator</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span> <span class="special">&amp;</span> init<span class="special">)</span><span class="special">;</span></pre></div>
37<div class="refsect1">
38<a name="idm45849507336288"></a><h2>Description</h2>
39<p>Returns a new <code class="computeroutput"><a class="link" href="counting_iterator.html" title="Class template counting_iterator">counting_iterator</a></code> starting at <code class="computeroutput">init</code>.</p>
40<p>
41
42For example, to create a counting iterator which returns unsigned integers and increments from one: </p>
43<pre class="programlisting"><span class="keyword">auto</span> <span class="identifier">iter</span> <span class="special">=</span> <span class="identifier">make_counting_iterator</span><span class="special">&lt;</span><span class="identifier">uint_</span><span class="special">&gt;</span><span class="special">(</span><span class="number">1</span><span class="special">)</span><span class="special">;</span>
44</pre>
45<p> </p>
46<div class="variablelist"><table border="0" class="variablelist compact">
47<colgroup>
48<col align="left" valign="top">
49<col>
50</colgroup>
51<tbody>
52<tr>
53<td><p><span class="term">Parameters:</span></p></td>
54<td><div class="variablelist"><table border="0" class="variablelist compact">
55<colgroup>
56<col align="left" valign="top">
57<col>
58</colgroup>
59<tbody><tr>
60<td><p><span class="term"><code class="computeroutput">init</code></span></p></td>
61<td><p>the initial value</p></td>
62</tr></tbody>
63</table></div></td>
64</tr>
65<tr>
66<td><p><span class="term">Returns:</span></p></td>
67<td><p>a <a class="link" href="counting_iterator.html" title="Class template counting_iterator">counting_iterator</a> with <code class="computeroutput">init</code>.</p></td>
68</tr>
69</tbody>
70</table></div>
71</div>
72</div>
73<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
74<td align="left"></td>
75<td align="right"><div class="copyright-footer">Copyright © 2013, 2014 Kyle Lutz<p>
76        Distributed under the Boost Software License, Version 1.0. (See accompanying
77        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>)
78      </p>
79</div></td>
80</tr></table>
81<hr>
82<div class="spirit-nav">
83<a accesskey="p" href="counting_iterator.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_compute/reference.html#header.boost.compute.iterator.counting_iterator_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="discard_iterator.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
84</div>
85</body>
86</html>
87