5 Jun
2013
5 Jun
'13
12:37 p.m.
Hi, I would like to return filtering_istream via std::unique_ptrstd::iostream so that client code can just use iostream interface without knowing what is actual stream type. Inside the factory function filtering_istream is prepared with possible filters attached. Problem is filters are attached by reference. My question is: how to elegantly attach filters to a filtering_istream so that they live as long as filtering_istream itself? How to attach a filter via shared_ptr for example? Regards, Szymon Gatner