As most know it's not possible to have a standard collection of references. It's also not possible to copy a stream object.
But what if I want to make a collection (say a std::vector
) of stream objects or stream object references?
I know I can wrap the stream object reference in e.g. a structure, but then you either need to implement the complete interface (if you want to use the wrapper directly as a stream, which I would prefer), or use a public getter function and use that everywhere to get the actual stream.
Is there a simpler way? C++11 solutions are okay.