Boost logo

Boost :

Subject: Re: [boost] [RangeEx] Using istream_range?
From: Neil Groves (neil_at_[hidden])
Date: 2008-10-21 04:59:50


Hey Robert,

I'm going to look at this problem ronight, if it's possible to sneak this
into my lunch-break I'll try it out on my GCC 4.x on the Mac. I don't think
I have a GCC 3.x to hand. If I find it's ok on GCC 4.x I will endeavour to
get GCC 3.x installed somewhere.

I apologise for the disruption caused by this issue.

I will attend to the matter as quickly as possible.

Best Wishes,

Neil Groves

On Tue, Oct 21, 2008 at 9:38 AM, Robert Jones <robertgbjones_at_[hidden]>wrote:

> On Tue, Oct 21, 2008 at 9:24 AM, Neil Groves <neil_at_[hidden]
> >wrote:
>
> > Hi Robert,
> >
> > You are very welcome. I hope this helps. Let me know how you get on.
> >
> >
> Badly!
>
> IIRC your code was pretty much the first thing I tried, which I have just
> tried again and
> generated this error message
>
> $ g++ -I.. -o junk.exe junk.cpp
> ../boost/range/istream_range.hpp: In function
> `boost::range<std::istream_iterator<Type, Elem, Traits, ptrdiff_t> > boost
> ::istream_range(std::basic_istream<_CharT, _Traits>&) [with Type = int,
> Elem
> = char, Traits = std::char_traits<char>]':
> junk.cpp:14: instantiated from here
> ../boost/range/istream_range.hpp:28: error: no matching function for call
> to
> `boost::range<std::istream_iterator<int, ch
> ar, std::char_traits<char>, ptrdiff_t> >::range(std::istream_iterator<char,
> char, std::char_traits<char>, ptrdiff_t>, st
> d::istream_iterator<char, char, std::char_traits<char>, ptrdiff_t>)'
> junk.cpp:14: note: candidates are: boost::range<std::istream_iterator<int,
> char, std::char_traits<char>, ptrdiff_t> >::r
> ange(const boost::range<std::istream_iterator<int, char,
> std::char_traits<char>, ptrdiff_t> >&)
> ../boost/range/range.hpp:162: note: boost::range<Iter>::range(Iter, Iter)
> [with Iter = std::istream_iterator<int, char,
> std::char_traits<char>, ptrdiff_t>]
> ../boost/range/range.hpp:155: note: boost::range<Iter>::range() [with Iter
> = std::istream_iterator<int, char, std::char
> _traits<char>, ptrdiff_t>]
>
> Just in case I'm having a blind moment (not uncommon I might add) I'm also
> attaching the full
> source, cut and pasted for accuracy
>
> #include <iostream>
> #include <iterator>
> #include "boost/range.hpp"
> #include "boost/range/istream_range.hpp"
> #include "boost/range/algorithm.hpp"
>
> void f( int i )
> {
> std :: cout << i << std :: endl;
> }
>
> int main( )
> {
> boost :: for_each( boost :: istream_range< int >( std :: cin ), f );
> return 0;
> }
>
> If it matters the compiler spec is
>
> $ g++ --version
> g++ (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
> Copyright (C) 2004 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> Thanks for your help Neil.
>
> - Rob.
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk