|
We'd like to always use str::stream for building strings in stream-like fashion. However, code in mongo/base is not supposed to throw exceptions or depend on code from outside mongo/base and mongo/platform.
This work item would further require moving mongo/bson/util/builder.h into mongo/base, or adding mongo/bson/util to the list of directories that files in base may depend on.
The exception-freeness part will be much harder, as BufBuilder and StringBuilder throw exceptions in some non-fatal cases, now – particularly, when a buffer grows to be "too large". Some of those cases should perhaps be fatal, but we probably depend on others not being fatal right now.
Labeling "Medium" time, because of the extensive work needed to make str::stream exception-free.
|