'Concatenating input streams in C++

I am hoping to find a C++ class, ideally in a standard library, which accepts multiple input streams and constructs a single input stream which comprises all the input from the first stream, then all the input from the second stream, and so on.

For reference, in case it helps, a stream like that is called a concatenated input stream in at least one other environment (namely Common Lisp). "Concatenated" seems like a useful general description.

I can imagine some workarounds, and I'll probably resort to something if I can't find a suitable class, but I just want to make sure I'm not overlooking a neat solution before I do that.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source