Boost C++ Libraries: Ticket #7408: istream_range should not pull istream https://svn.boost.org/trac10/ticket/7408 <p> To minimize the time you have to wait on the compiler, it is good to only #include the headers you really need. istream_range.hpp simply #includes &lt;istream&gt; when it does not need to — and that can penalize the runtime as well. </p> <p> &lt;iosfwd&gt; should be #included whenever you simply need the name of an I/O-related class, such as "basic_istream". Like the name implies, these are forward declarations. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7408 Trac 1.4.3 viboes Sat, 22 Sep 2012 19:31:55 GMT version, component changed; owner set https://svn.boost.org/trac10/ticket/7408#comment:1 https://svn.boost.org/trac10/ticket/7408#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Neil Groves</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.52.0</span> → <span class="trac-field-new">Boost 1.51.0</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">range</span> </li> </ul> Ticket Nathan Ridge Wed, 05 Jun 2013 00:55:39 GMT <link>https://svn.boost.org/trac10/ticket/7408#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7408#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/84644" title="[range] Don't include &lt;istream&gt; unnecessarily in istream_range.hpp ...">[84644]</a>) [range] Don't include &lt;istream&gt; unnecessarily in istream_range.hpp (refs <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>). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Nathan Ridge</dc:creator> <pubDate>Wed, 05 Jun 2013 00:57:27 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7408#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7408#comment:3</guid> <description> <p> Fixed in trunk. However, I'm not convinced that this accomplishes anything, as istream_range.hpp includes &lt;iterator&gt; to use istream_iterator, and &lt;iterator&gt; most likely needs to bring in &lt;istream&gt; to properly define istream_iterator (since it's a template class so its methods need to be defined in the header). libstdc++'s &lt;iterator&gt;, for example, brings in &lt;istream&gt;. </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/7408#comment:4 https://svn.boost.org/trac10/ticket/7408#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:14 GMT <link>https://svn.boost.org/trac10/ticket/7408#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7408#comment:5</guid> <description> <p> Fixed for 1.54. </p> </description> <category>Ticket</category> </item> <item> <author>ne01026@…</author> <pubDate>Wed, 19 Jun 2013 18:09:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7408#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7408#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7408#comment:3" title="Comment 3">nathanridge</a>: </p> <blockquote class="citation"> <p> Fixed in trunk. However, I'm not convinced that this accomplishes anything, as istream_range.hpp includes &lt;iterator&gt; to use istream_iterator, and &lt;iterator&gt; most likely needs to bring in &lt;istream&gt; to properly define istream_iterator (since it's a template class so its methods need to be defined in the header). libstdc++'s &lt;iterator&gt;, for example, brings in &lt;istream&gt;. </p> </blockquote> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;iterator&gt;</span><span class="cp"></span> <span class="kt">void</span> <span class="nf">foo</span> <span class="p">(</span><span class="o">::</span><span class="n">std</span> <span class="o">::</span><span class="n">wistream</span> <span class="o">&amp;</span> <span class="o">=</span> <span class="o">::</span><span class="n">std</span> <span class="o">::</span><span class="n">wcin</span><span class="p">);</span> </pre></div></div><p> error: ‘wcin’ is not a member of ‘std’ (good!) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Nathan Ridge</dc:creator> <pubDate>Wed, 19 Jun 2013 18:18:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7408#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7408#comment:7</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7408#comment:6" title="Comment 6">ne01026@…</a>: </p> <blockquote class="citation"> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7408#comment:3" title="Comment 3">nathanridge</a>: </p> <blockquote class="citation"> <p> Fixed in trunk. However, I'm not convinced that this accomplishes anything, as istream_range.hpp includes &lt;iterator&gt; to use istream_iterator, and &lt;iterator&gt; most likely needs to bring in &lt;istream&gt; to properly define istream_iterator (since it's a template class so its methods need to be defined in the header). libstdc++'s &lt;iterator&gt;, for example, brings in &lt;istream&gt;. </p> </blockquote> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;iterator&gt;</span><span class="cp"></span> <span class="kt">void</span> <span class="nf">foo</span> <span class="p">(</span><span class="o">::</span><span class="n">std</span> <span class="o">::</span><span class="n">wistream</span> <span class="o">&amp;</span> <span class="o">=</span> <span class="o">::</span><span class="n">std</span> <span class="o">::</span><span class="n">wcin</span><span class="p">);</span> </pre></div></div><p> error: ‘wcin’ is not a member of ‘std’ (good!) </p> </blockquote> <p> That would be because 'wcin' is defined in &lt;iostream&gt;, not &lt;istream&gt;, and &lt;iterator&gt; doesn't bring in &lt;iostream&gt;, only &lt;istream&gt;. istream_range.hpp has never brought in &lt;iostream&gt;, either, so I don't see how this is relevant. </p> </description> <category>Ticket</category> </item> </channel> </rss>