Boost C++ Libraries: Ticket #4620: Range Adaptor: enumerate(d) https://svn.boost.org/trac10/ticket/4620 <p> I use B.Range with B.Foreach closely and consider boost::adaptors::indexed() not so good one. I would like to use it as follows: </p> <div class="wiki-code"><div class="code"><pre><span class="n">std</span><span class="p">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">array</span><span class="p">;</span> <span class="n">BOOST_FOREACH</span><span class="p">(</span> <span class="n">boost</span><span class="p">::</span><span class="n">index_value</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&amp;&gt;</span> <span class="n">iv</span><span class="p">,</span> <span class="n">array</span> <span class="o">|</span> <span class="n">enumerated</span><span class="p">()</span> <span class="p">)</span> <span class="p">{</span> <span class="nb">int</span> <span class="n">i</span> <span class="o">=</span> <span class="n">iv</span><span class="o">.</span><span class="n">index</span><span class="p">();</span> <span class="n">T</span><span class="o">&amp;</span> <span class="n">t</span> <span class="o">=</span> <span class="n">iv</span><span class="o">.</span><span class="n">value</span><span class="p">();</span> <span class="o">...</span> <span class="p">}</span> </pre></div></div><p> I've implemented such one in my program (using indexed() as source), <a class="ext-link" href="http://gitorious.org/bombono-dvd/bombono-dvd/blobs/master/src/mlib/range/enumerate.h"><span class="icon">​</span>http://gitorious.org/bombono-dvd/bombono-dvd/blobs/master/src/mlib/range/enumerate.h</a> and hope it will be useful for others too. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4620 Trac 1.4.3 Ilya Murav'jov <muravev@…> Thu, 02 Sep 2010 11:30:02 GMT attachment set https://svn.boost.org/trac10/ticket/4620 https://svn.boost.org/trac10/ticket/4620 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">enumerate.h</span> </li> </ul> <p> enumerate.h </p> Ticket Neil Groves Thu, 13 Mar 2014 15:29:17 GMT <link>https://svn.boost.org/trac10/ticket/4620#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4620#comment:1</guid> <description> <p> I just wanted to update the ticket to explain that I am having issues when applying this patch as it was supplied with a variety of compilers and platforms. I'm going to investigate this further and produce a solution. It is however taking a lot longer than I would expect a simple patch application to take since it requires some development work and obviously documentation. </p> <p> I am having to reconsider my previous work. I am honestly wrestling with the idea that perhaps I should deprecate the old interface. I am also considering if this should be implemented in terms of other new work. </p> <p> I apologise for the delay. For the early delay this was simply due to me not having time to dedicate to Boost. This further delay, while other tickets have been addressed, is due to the issues outlined above. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Neil Groves</dc:creator> <pubDate>Sun, 08 Jun 2014 23:06:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4620#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4620#comment:2</guid> <description> <p> I have got an implementation of the enumerated adaptor implemented and working on many compilers and platforms with a similar interface to the one suggested by Ilya. </p> <p> I believe that having indexed and enumerated would create significant confusion. The indexed adaptor has not been taken up much since my design decision to put the index into the iterator was almost useless. I am therefore intending to rename my enumerated implementation to indexed and replace it. This is a very rare breaking change to Boost.Range, but one that will not affect many people due to the horrendous usability of my first design. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Neil Groves</dc:creator> <pubDate>Mon, 09 Jun 2014 01:14:03 GMT</pubDate> <title>status, milestone changed https://svn.boost.org/trac10/ticket/4620#comment:3 https://svn.boost.org/trac10/ticket/4620#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.56.0</span> </li> </ul> <p> The new indexed adaptor is committed to the develop branch. Once the regression tests successfully cycle I shall promote to the master branch. </p> Ticket Ilya Murav'jov Mon, 09 Jun 2014 08:38:49 GMT <link>https://svn.boost.org/trac10/ticket/4620#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4620#comment:4</guid> <description> <p> Thanks, I'll see it. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Neil Groves</dc:creator> <pubDate>Mon, 09 Jun 2014 11:09:40 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4620#comment:5 https://svn.boost.org/trac10/ticket/4620#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> This is working fine on develop. The new version is merged to master to be released in 1.56. </p> <p> Sorry for the length of time I required to get this done. This is definitely one of my poorer efforts maintaining Boost.Range. I believe I have learned to avoid some of my mistakes with this. </p> Ticket Ilya Murav'jov Tue, 10 Jun 2014 12:32:33 GMT <link>https://svn.boost.org/trac10/ticket/4620#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4620#comment:6</guid> <description> <p> Ah, don't worry! </p> </description> <category>Ticket</category> </item> </channel> </rss>