Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-09-03 11:27:27

"Robert Ramey" <ramey_at_[hidden]> wrote in message
> >"Dietmar Kuehl" <dietmar_kuehl_at_[hidden]> wrote:
> >|filter_stream out(tee(std::cout) | encode | gzip | file("some file"));

> FWIW - I do NOT like this idea. I concede its mostly a matter of taste but
> I think it adds another layer of syntax. I think the original .. push, etc
> is ok. But my preference would be for
> filter_stream out(
> tee(
> std::out,
> encode(
> gzip(
> file("somefile")
> )
> )
> )
> )
> I'm sure people are going to love this idea.

This is sort of like how Crypto++ works. There's a convention that filters have
to have constructors allowing them to be chained. I'd rather not do this,
however, since often filters will have other parameters that have to be passed
to their constructors, and if they multiple constructors, forcing them to add a
templated parameter at the end (or beginning) could lead to ambiguity, esp. on
weak compilers.

It's also puts the burden on filter and resource writes, rather than on the
library itself.

An alternative is this:

  filtering_ostream out(
    link( tree(std::out),
            file() ) );

This was actually part of the library until recently, when I axed it to make the
library smaller.


Boost list run by bdawes at, gregod at, cpdaniel at, john at