Boost C++ Libraries: Ticket #7407: istream_range does not compile with wcin https://svn.boost.org/trac10/ticket/7407 <p> The following code does not compile: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/range/istream_range.hpp&gt;</span><span class="cp"></span> <span class="k">static</span> <span class="kt">void</span> <span class="nf">trigger</span> <span class="p">()</span> <span class="p">{</span> <span class="o">::</span><span class="n">boost</span> <span class="o">::</span><span class="n">istream_range</span> <span class="o">&lt;</span> <span class="kt">int</span> <span class="o">&gt;</span> <span class="p">(</span><span class="o">::</span><span class="n">std</span> <span class="o">::</span><span class="n">cin</span><span class="p">);</span> <span class="o">::</span><span class="n">boost</span> <span class="o">::</span><span class="n">istream_range</span> <span class="o">&lt;</span> <span class="kt">int</span> <span class="o">&gt;</span> <span class="p">(</span><span class="o">::</span><span class="n">std</span> <span class="o">::</span><span class="n">wcin</span><span class="p">);</span> <span class="p">}</span> </pre></div></div><p> Result: </p> <pre class="wiki">In file included from boost.cc:1:0: /usr/include/boost/range/istream_range.hpp: In instantiation of ‘boost::iterator_range&lt;std::istream_iterator&lt;Type, Elem, Traits&gt; &gt; boost::range::istream_range(std::basic_istream&lt;Elem, Traits&gt;&amp;) [with Type = int; Elem = wchar_t; Traits = std::char_traits&lt;wchar_t&gt;]’: boost.cc:5:46: required from here /usr/include/boost/range/istream_range.hpp:31:46: error: no matching function for call to ‘std::istream_iterator&lt;int, char, std::char_traits&lt;char&gt;, long int&gt;::istream_iterator(std::basic_istream&lt;wchar_t&gt;&amp;)’ /usr/include/boost/range/istream_range.hpp:31:46: note: candidates are: In file included from /usr/include/c++/4.7/iterator:66:0, from /usr/include/boost/range/istream_range.hpp:16, from boost.cc:1: /usr/include/c++/4.7/bits/stream_iterator.h:72:7: note: std::istream_iterator&lt;_Tp, _CharT, _Traits, _Dist&gt;::istream_iterator(const std::istream_iterator&lt;_Tp, _CharT, _Traits, _Dist&gt;&amp;) [with _Tp = int; _CharT = char; _Traits = std::char_traits&lt;char&gt;; _Dist = long int; std::istream_iterator&lt;_Tp, _CharT, _Traits, _Dist&gt; = std::istream_iterator&lt;int, char, std::char_traits&lt;char&gt;, long int&gt;] /usr/include/c++/4.7/bits/stream_iterator.h:72:7: note: no known conversion for argument 1 from ‘std::basic_istream&lt;wchar_t&gt;’ to ‘const std::istream_iterator&lt;int, char, std::char_traits&lt;char&gt;, long int&gt;&amp;’ /usr/include/c++/4.7/bits/stream_iterator.h:68:7: note: std::istream_iterator&lt;_Tp, _CharT, _Traits, _Dist&gt;::istream_iterator(std::istream_iterator&lt;_Tp, _CharT, _Traits, _Dist&gt;::istream_type&amp;) [with _Tp = int; _CharT = char; _Traits = std::char_traits&lt;char&gt;; _Dist = long int; std::istream_iterator&lt;_Tp, _CharT, _Traits, _Dist&gt;::istream_type = std::basic_istream&lt;char&gt;] /usr/include/c++/4.7/bits/stream_iterator.h:68:7: note: no known conversion for argument 1 from ‘std::basic_istream&lt;wchar_t&gt;’ to ‘std::istream_iterator&lt;int, char, std::char_traits&lt;char&gt;, long int&gt;::istream_type&amp; {aka std::basic_istream&lt;char&gt;&amp;}’ /usr/include/c++/4.7/bits/stream_iterator.h:64:26: note: std::istream_iterator&lt;_Tp, _CharT, _Traits, _Dist&gt;::istream_iterator() [with _Tp = int; _CharT = char; _Traits = std::char_traits&lt;char&gt;; _Dist = long int] /usr/include/c++/4.7/bits/stream_iterator.h:64:26: note: candidate expects 0 arguments, 1 provided </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7407 Trac 1.4.3 viboes Sat, 22 Sep 2012 19:31:13 GMT version, component changed; owner set https://svn.boost.org/trac10/ticket/7407#comment:1 https://svn.boost.org/trac10/ticket/7407#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 Sun, 09 Jun 2013 02:34:38 GMT <link>https://svn.boost.org/trac10/ticket/7407#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7407#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/84707" title="[range] Fixed a bug in istream_range() that prevented it from working ...">[84707]</a>) [range] Fixed a bug in istream_range() that prevented it from working with character types other than 'char' (refs <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>). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Nathan Ridge</dc:creator> <pubDate>Sun, 09 Jun 2013 02:35:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7407#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7407#comment:3</guid> <description> <p> Thanks for the report! Fixed in trunk. </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/7407#comment:4 https://svn.boost.org/trac10/ticket/7407#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:09 GMT <link>https://svn.boost.org/trac10/ticket/7407#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7407#comment:5</guid> <description> <p> Fixed for 1.54. </p> </description> <category>Ticket</category> </item> </channel> </rss>