Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2006-03-22 11:40:49


João Abecasis wrote:
>>>Also what is the rationale for singling out std::basic_string (and
>>>Char const *) instead of going for the more general Range concept?
>>
>>Very off-topic here, but I'm just following the TR1 regex spec. Besides,
>>in the future, Range won't cover Char const *. A Range-based interface
>>might make for a nice extension to TR1, though.
>
> For Spirit, the situation is the same. To circumvent this, I'm locally
> extending the Range concept to include istreams, fstreams and, when
> Range drops support for those, string literals.
>
> To this end, there's an extensible as_range<T> class template that is
> specialized to offer automatic conversion of T to a real range. Working
> code is available through the link above.
>
> What do you think of this?

I think it sounds interesting, but Xpressive requires bidirectional
iterators. I doubt your range adaptors for istream and fstream produce
bidirectional ranges, do they?

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

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