Boost C++ Libraries: Ticket #1151: [range] make_indirect_range() https://svn.boost.org/trac10/ticket/1151 <p> The following function is useful sometimes: </p> <div class="wiki-code"><div class="code"><pre><span class="k">template</span> <span class="o">&lt;</span><span class="k">class</span> <span class="nc">R</span><span class="o">&gt;</span> <span class="kr">inline</span> <span class="n">boost</span><span class="o">::</span><span class="n">iterator_range</span><span class="o">&lt;</span><span class="n">boost</span><span class="o">::</span><span class="n">indirect_iterator</span><span class="o">&lt;</span><span class="k">typename</span> <span class="n">boost</span><span class="o">::</span><span class="n">range_result_iterator</span><span class="o">&lt;</span><span class="n">R</span><span class="o">&gt;::</span><span class="n">type</span> <span class="o">&gt;</span> <span class="o">&gt;</span> <span class="n">make_indirect_range</span><span class="p">(</span><span class="n">R</span><span class="o">&amp;</span> <span class="n">r</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="n">boost</span><span class="o">::</span><span class="n">iterator_range</span><span class="o">&lt;</span><span class="n">boost</span><span class="o">::</span><span class="n">indirect_iterator</span><span class="o">&lt;</span><span class="k">typename</span> <span class="n">boost</span><span class="o">::</span><span class="n">range_result_iterator</span><span class="o">&lt;</span><span class="n">R</span><span class="o">&gt;::</span><span class="n">type</span> <span class="o">&gt;</span> <span class="o">&gt;</span> <span class="p">(</span><span class="n">r</span><span class="p">);</span> <span class="p">}</span> </pre></div></div><p> I'd assume there ought to be similar functions for all iterators presented? Or is there an easier way to do this? </p> <p> P.S. No component for range yet? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1151 Trac 1.4.3 Marshall Clow Tue, 21 Aug 2007 21:03:18 GMT component changed; owner set https://svn.boost.org/trac10/ticket/1151#comment:1 https://svn.boost.org/trac10/ticket/1151#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Thorsten Ottosen</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">range</span> </li> </ul> Ticket Thorsten Ottosen Tue, 23 Oct 2007 19:24:15 GMT status, type changed; resolution set https://svn.boost.org/trac10/ticket/1151#comment:2 https://svn.boost.org/trac10/ticket/1151#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>type</strong> <span class="trac-field-old">Patches</span> → <span class="trac-field-new">Feature Requests</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> The generator functions are useful. I'm still waiting for somebody to implement range_ex, which adds all these fancy functions and more. </p> Ticket