scripted-diff: remove Optional & nullopt

-BEGIN VERIFY SCRIPT-
git rm src/optional.h

sed -i -e 's/Optional</std::optional</g' $(git grep -l 'Optional<' src)

sed -i -e 's/{nullopt}/{std::nullopt}/g' $(git grep -l 'nullopt' src)
sed -i -e 's/ nullopt;/ std::nullopt;/g' $(git grep -l 'nullopt' src)
sed -i -e 's/ nullopt)/ std::nullopt)/g' $(git grep -l 'nullopt' src)
sed -i -e 's/(nullopt)/(std::nullopt)/g' $(git grep -l 'nullopt' src)
sed -i -e 's/ nullopt,/ std::nullopt,/g' $(git grep -l 'nullopt' src)
sed -i -e 's/? nullopt :/? std::nullopt :/g' $(git grep -l 'nullopt' src)
sed -i -e 's/: nullopt}/: std::nullopt}/g' $(git grep -l 'nullopt' src)

sed -i -e '/optional.h \\/d' src/Makefile.am

sed -i -e '/#include <optional.h>/d' src/test/fuzz/autofile.cpp src/test/fuzz/buffered_file.cpp src/test/fuzz/node_eviction.cpp

sed -i -e 's/#include <optional.h>/#include <optional>/g' $(git grep -l '#include <optional.h>' src)
-END VERIFY SCRIPT-
This commit is contained in:
fanquake
2021-03-15 10:41:30 +08:00
parent 3c631917f3
commit 57e980d13c
49 changed files with 165 additions and 189 deletions

View File

@@ -7,7 +7,7 @@
#include <clientversion.h>
#include <hash.h> // For Hash()
#include <key.h> // For CKey
#include <optional.h>
#include <optional>
#include <sync.h>
#include <test/util/logging.h>
#include <test/util/setup_common.h>
@@ -227,9 +227,9 @@ public:
bool default_int = false;
bool default_bool = false;
const char* string_value = nullptr;
Optional<int64_t> int_value;
Optional<bool> bool_value;
Optional<std::vector<std::string>> list_value;
std::optional<int64_t> int_value;
std::optional<bool> bool_value;
std::optional<std::vector<std::string>> list_value;
const char* error = nullptr;
explicit Expect(util::SettingsValue s) : setting(std::move(s)) {}