Modify

Ticket #7407 (closed Bugs: fixed)

Opened 19 months ago

Last modified 10 months ago

istream_range does not compile with wcin

Reported by: Christopher Yeleighton <giecrilj@…> Owned by: neilgroves
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

Attachments

Change History

comment:1 Changed 19 months ago by viboes

  • Owner set to neilgroves
  • Version changed from Boost 1.52.0 to Boost 1.51.0
  • Component changed from None to range

comment:2 Changed 10 months ago by nathanridge

(In [84707]) [range] Fixed a bug in istream_range() that prevented it from working with character types other than 'char' (refs #7407).

comment:3 Changed 10 months ago by nathanridge

Thanks for the report! Fixed in trunk.

comment:4 Changed 10 months ago by nathanridge

  • Status changed from new to closed
  • Resolution set to fixed

(In [84823]) [range] Merge Boost.Range bug fixes to release branch (fixes #6944; fixes #7407; fixes #7408; fixes #7731; fixes #7827; fixes #8338; fixes #8453).

comment:5 Changed 10 months ago by nathanridge

Fixed for 1.54.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.