Boost C++ Libraries: Ticket #12068: boost::filtered_range is not default constructible https://svn.boost.org/trac10/ticket/12068 <p> Filtered_range is not default_constructible which makes it impossible to (for example) put it into a class that has to be default-initialized and resets it (filtered_range) later. </p> <p> I'm quite new to boost internals, but I fail to see any drawbacks of adding the default constructor: </p> <p> --- include/boost/range/adaptor/filtered.hpp.orig 2016-03-14 15:26:32.228892237 +0100 +++ include/boost/range/adaptor/filtered.hpp 2016-03-14 15:26:28.724846102 +0100 @@ -41,6 +41,8 @@ </p> <blockquote> <p> typedef typename default_constructible_unary_fn_gen&lt;P, bool&gt;::type </p> <blockquote> <p> pred_t; </p> </blockquote> </blockquote> <p> + filtered_range() {} + </p> <blockquote> <p> filtered_range(P p, R&amp; r) : base(make_filter_iterator(pred_t(p), </p> <blockquote> <p> boost::begin(r), boost::end(r)), </p> </blockquote> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12068 Trac 1.4.3 Michel Morin Mon, 14 Mar 2016 16:53:31 GMT type, component changed; owner set https://svn.boost.org/trac10/ticket/12068#comment:1 https://svn.boost.org/trac10/ticket/12068#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Neil Groves</span> </li> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Feature Requests</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">range</span> </li> </ul> Ticket Michel Morin Mon, 14 Mar 2016 17:07:53 GMT <link>https://svn.boost.org/trac10/ticket/12068#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12068#comment:2</guid> <description> <p> For reference, range views in Eric Niebler's Range v3 have default constructors. </p> <p> P.S. If you want to workaround, you can use <code>boost::optional</code>'s deferred initialization. </p> </description> <category>Ticket</category> </item> <item> <author>Aleksej Lebedev <root@…></author> <pubDate>Mon, 14 Mar 2016 17:11:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12068#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12068#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12068#comment:2" title="Comment 2">michel</a>: </p> <blockquote class="citation"> <p> P.S. If you want to workaround, you can use <code>boost::optional</code>'s deferred initialization. </p> </blockquote> <p> Actually, we just applied the patch. But thanks for the suggestion anyway. </p> </description> <category>Ticket</category> </item> </channel> </rss>