Boost logo

Boost Users :

From: EMalenfant_at_[hidden]
Date: 2006-03-22 17:06:28


I wanted an InputFilter for removing comments from C++ source files. Since
it seemed easier to write an OutputFilter, I decided to write that, and use
iostreams::inverse to make an InputFilter out of it. However, it seems that
inverse can't be used with "stateful" filters.

Consider the following, using dictionary_output_filter from the tutorial:

    namespace io = boost::iostreams;

    const std::string source("This foo will be bar");

    io::example::dictionary dict;
    dict.add("foo", "bar");

    io::filtering_istream in;
    in.push(io::array_source(source.c_str(), source.length()));

    io::copy(in, std::cout);

    This bar will be
instead of the expected:
    This bar will be bar
Is this a "known limitation"? Is there a workaround? Am I doing something


A conclusion is the place where you got tired of thinking

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at