Boost C++ Libraries: Ticket #7827: [range] cant compile r | indexed to range algorithm https://svn.boost.org/trac10/ticket/7827 <p> follow code is compile error: </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;boost/range/adaptor/indexed.hpp&gt; #include &lt;boost/range/algorithm/min_element.hpp&gt; int main() { std::vector&lt;int&gt; v = {3, 1, 4}; auto m = boost::min_element(v | boost::adaptors::indexed(0)); auto i = m.index(); std::cout &lt;&lt; i &lt;&lt; std::endl; std::cout &lt;&lt; *m &lt;&lt; std::endl; } </pre><pre class="wiki">In file included from D:\GitHub\Boost\boost-svn/boost/range/concepts.hpp:19:0, from D:\GitHub\Boost\boost-svn/boost/range/algorithm/equal.hpp:14, from D:\GitHub\Boost\boost-svn/boost/range/iterator_range_core.hpp:29, from D:\GitHub\Boost\boost-svn/boost/range/iterator_range.hpp:13, from D:\GitHub\Boost\boost-svn/boost/range/adaptor/indexed.hpp:21, from C:\language\cpp\main.cpp:3: D:\GitHub\Boost\boost-svn/boost/concept_check.hpp: In instantiation of 'boost::DefaultConstructible&lt;TT&gt;::~DefaultConstructible() [with TT = boost::range_detail::indexed_iterator&lt;__gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int&gt; &gt; &gt;]': D:\GitHub\Boost\boost-svn/boost/concept/usage.hpp:22:29: required from 'boost::concepts::usage_requirements&lt;Model&gt;::~usage_requirements() [with Model = boost::DefaultConstructible&lt;boost::range_detail::indexed_iterator&lt;__gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int&gt; &gt; &gt; &gt;]' D:\GitHub\Boost\boost-svn/boost/concept/detail/general.hpp:38:28: required from 'static void boost::concepts::requirement&lt;boost::concepts::failed************ Model::************&gt;::failed() [with Model = boost::concepts::usage_requirements&lt;boost::DefaultConstructible&lt;boost::range_detail::indexed_iterator&lt;__gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int&gt; &gt; &gt; &gt; &gt;]' ... </pre><p> Because <code>indexed_iterator</code> hasn't default constructor. I attach patch. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7827 Trac 1.4.3 Akira Takahashi <faithandbrave@…> Tue, 25 Dec 2012 03:07:30 GMT attachment set https://svn.boost.org/trac10/ticket/7827 https://svn.boost.org/trac10/ticket/7827 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">indexed.hpp.patch</span> </li> </ul> Ticket Akira Takahashi <faithandbrave@…> Tue, 25 Dec 2012 03:07:48 GMT attachment set https://svn.boost.org/trac10/ticket/7827 https://svn.boost.org/trac10/ticket/7827 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">indexed.cpp.patch</span> </li> </ul> <p> add test </p> Ticket Nathan Ridge Mon, 03 Jun 2013 09:00:49 GMT <link>https://svn.boost.org/trac10/ticket/7827#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7827#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/84617" title="[range] Make iterator of 'indexed' adaptor default-constructible (refs ...">[84617]</a>) [range] Make iterator of 'indexed' adaptor default-constructible (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7827" title="#7827: Bugs: [range] cant compile r | indexed to range algorithm (closed: fixed)">#7827</a>). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Nathan Ridge</dc:creator> <pubDate>Mon, 03 Jun 2013 09:05:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7827#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7827#comment:2</guid> <description> <p> Thanks for the report and patch! Fixed in trunk. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Akira Takahashi</dc:creator> <pubDate>Mon, 03 Jun 2013 09:09:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7827#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7827#comment:3</guid> <description> <p> Thanks for fix! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Nathan Ridge</dc:creator> <pubDate>Tue, 18 Jun 2013 02:22:09 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7827#comment:4 https://svn.boost.org/trac10/ticket/7827#comment:4 <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/84823" title="[range] Merge Boost.Range bug fixes to release branch (fixes #6944; ...">[84823]</a>) [range] Merge Boost.Range bug fixes to release branch (fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6944" title="#6944: Bugs: Some Range concepts use the incorrect Iterator concept (closed: fixed)">#6944</a>; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7407" title="#7407: Bugs: istream_range does not compile with wcin (closed: fixed)">#7407</a>; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7408" title="#7408: Bugs: istream_range should not pull istream (closed: fixed)">#7408</a>; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7731" title="#7731: Bugs: irange doesn't end iteration properly when step_size is 3 or more (closed: fixed)">#7731</a>; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7827" title="#7827: Bugs: [range] cant compile r | indexed to range algorithm (closed: fixed)">#7827</a>; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8338" title="#8338: Bugs: Iterator range does not work with pointer to array as iterator (closed: fixed)">#8338</a>; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8453" title="#8453: Bugs: Incorrect configuration macro BOOST_NO_PARTIAL_TEMPLATE_SPECIALIZATION (closed: fixed)">#8453</a>). </p> Ticket Nathan Ridge Tue, 18 Jun 2013 02:23:18 GMT <link>https://svn.boost.org/trac10/ticket/7827#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7827#comment:5</guid> <description> <p> Fixed for 1.54. </p> </description> <category>Ticket</category> </item> </channel> </rss>