find ./src -type f \( -iname \*.h -o -iname \*.cpp \) -exec sed -i 's/Optional</std::optional</g' {} \; find ./src -type f \( -iname \*.h -o -iname \*.cpp \) -exec sed -i 's/nullopt/std::nullopt/g' {} \; find ./src -type f \( -iname \*.h -o -iname \*.cpp \) -exec sed -i 's/#include <optional.h>//g' {} \; rm ./src/optional.h
a few changes apart from the scripts above were necessary:
1- on psbt.cpp a use of Boost::Optional::get_ptr() (doesn't exist in std::optional) was replaced with a slightly more cumbersome construct to preserve behavior (either pass a pointer to the value if initialized or nullptr)
2- in both wallet/rpcwallet.cpp and wallet/wallet.cpp a funky conditional initialization via Boost::MakeOptional was used to workaround gcc bug #47679. I've removed that, thinking it unlikely that bug exists for std::optional
3- in bench/wallet_balance.cpp a call to Boost::Optional::get_value_or is replaced with std::optional::value_or
Depends on D8493