frederic.bron@alcan.com wrote:
ok, I have seen this now, thanks. However, I must create a derived class from dual_use_filter and those no-op operation are not virtual and it is good practice not to redefine non-virtual member functions.
So what's happening whenever I use a pointer or reference to a base class?
sink, source, filter, dual_use_filter, etc., are designed specifically to allow user-defined components to inherit a partial implementation; they are like std::iterator or std::unary function in this respect. A pointer to the base class would be useless, because the base does not actually model any of the Boost.Iostreams concepts. dual_use_filter is not actually a model of Dual Use Filter; it is just a helper. If you feel uncomfortable using the convenience classes, it is simple enough to define a component from scratch by defining suitable member types char_type and category.
Maybe this never happens because chain.push takes a template parameter... am I right?
Yes
Regards,
F. Bron
Best Regards, -- Jonathan Turkanis CodeRage http://www.coderage.com