Boost C++ Libraries: Ticket #6212: "Method 3.1: Implement a Range Adaptor without arguments" does not implement https://svn.boost.org/trac10/ticket/6212 <p> The sample code in <a class="ext-link" href="http://svn.boost.org/svn/boost/trunk/libs/range/doc/html/range/reference/extending/method_3/method_3_1.html"><span class="icon">​</span>Method 3.1: Implement a Range Adaptor without arguments</a> is incomplete; it does not provide for the syntax <code>range | ::boost:: adaptors:: reversed</code>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6212 Trac 1.4.3 ne01026@… Mon, 05 Dec 2011 14:44:25 GMT <link>https://svn.boost.org/trac10/ticket/6212#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6212#comment:1</guid> <description> <p> It turns out that the following code is needed to finish up: </p> <div class="wiki-code"><div class="code"><pre><span class="k">namespace</span> <span class="p">{</span> <span class="k">const</span> <span class="n">detail</span><span class="o">::</span><span class="n">reverse_forwarder</span> <span class="n">reversed</span> <span class="o">=</span> <span class="n">detail</span><span class="o">::</span><span class="n">reverse_forwarder</span><span class="p">();</span> <span class="p">}</span> </pre></div></div><p> I wonder why the explicit assignment is needed? Or should it be a reference instead? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Nathan Ridge</dc:creator> <pubDate>Wed, 02 Jan 2013 07:34:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6212#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6212#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6212#comment:1" title="Comment 1">ne01026@…</a>: </p> <blockquote class="citation"> <p> I wonder why the explicit assignment is needed? Or should it be a reference instead? </p> </blockquote> <p> It should not be a reference (it would be a reference to a temporary which will have died long before one tries to use it). </p> <p> Regarding why the explicit assignment is needed, see <a class="ext-link" href="http://stackoverflow.com/questions/8092670/uninitialized-const"><span class="icon">​</span>http://stackoverflow.com/questions/8092670/uninitialized-const</a>. I believe </p> <pre class="wiki"> const detail::reverse_forwarder reversed = {}; </pre><p> also does the trick. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Nathan Ridge</dc:creator> <pubDate>Wed, 02 Jan 2013 07:51:24 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6212#comment:3 https://svn.boost.org/trac10/ticket/6212#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82314" title="[range] fixed #6212 (missing step in documentation for how to write a ...">[82314]</a>) [range] fixed <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6212" title="#6212: Bugs: &#34;Method 3.1: Implement a Range Adaptor without arguments&#34; does not ... (closed: fixed)">#6212</a> (missing step in documentation for how to write a range adaptor) </p> Ticket Nathan Ridge Wed, 02 Jan 2013 07:53:47 GMT <link>https://svn.boost.org/trac10/ticket/6212#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6212#comment:4</guid> <description> <p> Fixed in trunk. The fix will appear in 1.53 (I will merge to release branch after 1.53 beta release). </p> <p> Thanks for the report! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Nathan Ridge</dc:creator> <pubDate>Mon, 14 Jan 2013 09:19:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6212#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6212#comment:5</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82487" title="[range] Merge documentation fixes and minor refactoring of docs (refs ...">[82487]</a>) [range] Merge documentation fixes and minor refactoring of docs (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5160" title="#5160: Bugs: Documentation: missing argument to replace_copy_if (closed: fixed)">#5160</a>; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5314" title="#5314: Bugs: wrong example in document (closed: fixed)">#5314</a>; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5440" title="#5440: Bugs: Documentation error for boost::inner_product from boost range library (closed: fixed)">#5440</a>; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5775" title="#5775: Bugs: documentation: wrong description of pop_heap (copy-paste from push_heap) (closed: fixed)">#5775</a>; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6212" title="#6212: Bugs: &#34;Method 3.1: Implement a Range Adaptor without arguments&#34; does not ... (closed: fixed)">#6212</a>; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7585" title="#7585: Bugs: Boost.Range Adaptors indexed: mistake in online documentation (closed: fixed)">#7585</a>; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7843" title="#7843: Bugs: missing example for 'tokenized' range adaptor (closed: fixed)">#7843</a>; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7866" title="#7866: Bugs: Minor doc typo in Boost.Range (closed: fixed)">#7866</a>). </p> </description> <category>Ticket</category> </item> </channel> </rss>