Boost logo

Boost Users :

Subject: [Boost-users] [Iostreams] Safely returning filtering_istream from function
From: Szymon Gatner (szymon.gatner_at_[hidden])
Date: 2013-06-05 08:37:50


Hi,

I would like to return filtering_istream via std::unique_ptr<std::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



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net