It's not real, since not istream
will be pushed into filtering_stream
(for my boost 1.48 it will be boost::iostreams::detail::mode_adapter<boost::iostreams::input, std::istream>
for example), you can check it type by component_type
function. However, I have no ideas, why you need to get stream
from filtering_stream
, since you send reference - you should have this object in places, where you use this filtering_stream
.
Also, you can use reference_wrapper
for this case (i.e push(boost::ref(in));
) and then get it by component using
auto ptr = component<boost::reference_wrapper<std::istream>>(1);