
Jeffrey Bosboom wrote:
I've written simple versions of streaming operators (both output and input) for the standard containers as a simple, low-barrier-to-entry form of serialization. Do you plan to provide the input operators too? (I understand this would involve some restrictions on the streamed forms of the container elements to prevent parsing ambiguity.)
We have no plans to implement input operators. You're correct that there is ambiguity in the form of the stream. There is also ambiguity in the items that are streamed. In general, containers of strings would be problematic.
As a technical question, how are the operators found? They can't be added to std (adding to std is undefined behavior), and there's otherwise no one namespace to put them in that will allow them to be found for all element types (at least with my understanding of ADL).
The operators are added to namespace std, and they are found through ADL. I don't know how to make this work otherwise. I think that as long as all the compilers supported by boost also behave correctly when extending std, we're safe.
By the way, "Explore" is a very uninformative name.
I agree. It came about during BoostCon 2007 when we had some grander ideas about what this library would be. It was to be a way to 'explore' your data, and there were some initial template metaprogramming approaches. The library is ended up in a much more modest form, but the name has remained. Any ideas for a better name? 'container_streaming' is a bit wordy, and even misleading due to the lack of input operators. -- Jeff Faust