|
Boost : |
From: João Abecasis (jpabecasis_at_[hidden])
Date: 2006-03-22 06:59:00
[moving this thread to the the main Boost list, please don't reply to
Boost-Docs.]
For the benefit of those who are joining us now, I'm pursuing a
range-based interface for Spirit (see my post on Spirit's list
http://tinyurl.com/npvnz).
Eric Niebler wrote:
> 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?
Regards,
João
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk