filtering_stream
not reaching the Sink at the end of the chain?cout
but not with another ostream
?operator|
is ambiguous?finite_state_filter
examples?filtering_stream
not reaching the Sink at the end of the chain?
You may need to flush the stream. Note, however, that there is no guarantee that all data written to a filtering_stream
will be forwarded to the final Sink until the stream is closed, unless all the Filters in the underlying chain
are Closable.
It's also possible that a buggy Filter is modifying data in a way you don't expect.
cout
but not with another ostream
?The Iostreams library stores streams and stream buffers by reference; consequently, streams and stream buffers must outlive any filter chain to which they are added. This is not a problem for std::cout, since it is guaranteed to live until the end of the program.
Check to make sure that the ostream
is not being destroyed before the filtering_stream
. If both objects are constructed on the stack within the same block, make sure that the ostream
is constructed first.
Use a tee_filter
or tee_device
. See tee
.
operator|
is ambiguous?
During overload resolution for an expression involving operator|
, your compiler could be considering an implicit conversion from an intergral type to a Pipable Filter. Make sure that all your Pipable Filters have explicit
constructors. See Pipelines.
finite_state_filter
examples?
The template finite_state_filter
requires a highly standard-conforming compiler. See Portability and the Compiler Status Tables for details.
Revised 20 May, 2004
© Copyright Jonathan Turkanis, 2004
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)