#7407 closed Bugs (fixed)
istream_range does not compile with wcin
Reported by: | Owned by: | Neil Groves | |
---|---|---|---|
Milestone: | To Be Determined | Component: | range |
Version: | Boost 1.51.0 | Severity: | Problem |
Keywords: | Cc: |
Description
The following code does not compile:
#include <boost/range/istream_range.hpp> static void trigger () { ::boost ::istream_range < int > (::std ::cin); ::boost ::istream_range < int > (::std ::wcin); }
Result:
In file included from boost.cc:1:0: /usr/include/boost/range/istream_range.hpp: In instantiation of ‘boost::iterator_range<std::istream_iterator<Type, Elem, Traits> > boost::range::istream_range(std::basic_istream<Elem, Traits>&) [with Type = int; Elem = wchar_t; Traits = std::char_traits<wchar_t>]’: 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<int, char, std::char_traits<char>, long int>::istream_iterator(std::basic_istream<wchar_t>&)’ /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<_Tp, _CharT, _Traits, _Dist>::istream_iterator(const std::istream_iterator<_Tp, _CharT, _Traits, _Dist>&) [with _Tp = int; _CharT = char; _Traits = std::char_traits<char>; _Dist = long int; std::istream_iterator<_Tp, _CharT, _Traits, _Dist> = std::istream_iterator<int, char, std::char_traits<char>, long int>] /usr/include/c++/4.7/bits/stream_iterator.h:72:7: note: no known conversion for argument 1 from ‘std::basic_istream<wchar_t>’ to ‘const std::istream_iterator<int, char, std::char_traits<char>, long int>&’ /usr/include/c++/4.7/bits/stream_iterator.h:68:7: note: std::istream_iterator<_Tp, _CharT, _Traits, _Dist>::istream_iterator(std::istream_iterator<_Tp, _CharT, _Traits, _Dist>::istream_type&) [with _Tp = int; _CharT = char; _Traits = std::char_traits<char>; _Dist = long int; std::istream_iterator<_Tp, _CharT, _Traits, _Dist>::istream_type = std::basic_istream<char>] /usr/include/c++/4.7/bits/stream_iterator.h:68:7: note: no known conversion for argument 1 from ‘std::basic_istream<wchar_t>’ to ‘std::istream_iterator<int, char, std::char_traits<char>, long int>::istream_type& {aka std::basic_istream<char>&}’ /usr/include/c++/4.7/bits/stream_iterator.h:64:26: note: std::istream_iterator<_Tp, _CharT, _Traits, _Dist>::istream_iterator() [with _Tp = int; _CharT = char; _Traits = std::char_traits<char>; _Dist = long int] /usr/include/c++/4.7/bits/stream_iterator.h:64:26: note: candidate expects 0 arguments, 1 provided
Change History (5)
comment:1 by , 10 years ago
Component: | None → range |
---|---|
Owner: | set to |
Version: | Boost 1.52.0 → Boost 1.51.0 |
comment:2 by , 9 years ago
comment:4 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(In [84707]) [range] Fixed a bug in istream_range() that prevented it from working with character types other than 'char' (refs #7407).