Boost logo

Boost :

From: christopher diggins (cdiggins_at_[hidden])
Date: 2005-01-12 15:09:41


----- Original Message -----
From: "Jonathan Turkanis" <technews_at_[hidden]>
> I don't see why this is better than
>
> struct toupper_filter : input_filter {
> template<typename Source>
> int get(Source& src) { return toupper(boost::io::get(src)); }
> };
>
> and its cousins.

Then that pretty much closes the discussion. If you do not see the benefits
of the lower complexity, then there really is little more I can do to
convince you otherwise.

>> int main() {
>> fstream("input.txt") > Filter(ToUpper);
>> }
>
> This won't work, since fstream("input.txt") produces a temporary object
> which
> cannot be used to initialize a non-const reference. Therefore operator<
> would
> have to be declared to take a const reference, and the non-const
> extraction
> functions would not be usable.

I already made it work by creating temporary helper objects which take the
address of the temporary objects.

> I have to go no, but I'll continue this discussion later.

CD


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