[SERVER-68378] Remove all uses of boost/optional_io.hpp Created: 28/Jul/22  Updated: 29/Oct/23  Resolved: 29/Jul/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split from SERVER-68121 clang-tool boost::optional -> std::op... Backlog
Related
related to SERVER-70086 remove extraneous include of boost/op... Closed
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2022-08-08
Participants:

 Description   
  • 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.


Generated at Thu Feb 08 06:10:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.