- Extend unittest ASSERTs and Matchers to print optionals. Most uses of optional_io.hpp are for _test.cpp files and will be unnecessary when we teach the test ASSERT macros to print optionals.
- Outside of that use, there are only about 3 places in the codebase that need to use optional_io.hpp in production code. Rewrite these uses to use the utilities provided by new header mongo/util/optional_util.h.
optional_util.h will provide a wrapper that can stream optionals:
It's pretty straightforward. Instead of:
std::cout << someOptional;
|
They'll just use:
std::cout << optional_io::Extension{someOptional};
|
This will use the same format as boost/optional_io.hpp but will
also support std::optional.
|