frederic.bron@alcan.com wrote:
I want to write a filter but this filter needs to do some things when the stream is ending. Is it enough to do the following? I want the close function to be called at the end of the stream. Do I need to category_flag to inherit from (closable_tag)?
class my_filter : public io::dual_use_filter { public: template<typename Source> int get(Source&) ; template<typename Sink> bool put(Sink&, int) ; template<typename Device> void close(Device&, std::ios_base::openmode) ; } ;
Hi Fred, Eric is correct: the convenience base class dual_use_filter has category convertible to closable_tag, and a no-op implementation of close. -- Jonathan Turkanis CodeRage http://www.coderage.com