Use C++23 std::expected (#8823)

This commit is contained in:
Gold856
2026-07-02 02:10:52 -04:00
committed by GitHub
parent 1299abc173
commit 4e7dd4cfbb
37 changed files with 133 additions and 2709 deletions

View File

@@ -9,7 +9,7 @@ Subject: [PATCH 16/25] Add parse_or_throw
2 files changed, 11 insertions(+)
diff --git a/json.cpp b/json.cpp
index baefe6317126f95ec75fe9d9a896923d0a90e720..49fbf92ea6e67e771f051f10b65ac795351c6f3d 100644
index 11f2ccde854aed19724c991b36905b221e71ae84..84712da562ee6b1966bae788fbf32876eaec4cef 100644
--- a/json.cpp
+++ b/json.cpp
@@ -1276,6 +1276,16 @@ json::parse(std::string_view s)
@@ -30,13 +30,13 @@ index baefe6317126f95ec75fe9d9a896923d0a90e720..49fbf92ea6e67e771f051f10b65ac795
json::StatusToString(json::Status status)
{
diff --git a/json.h b/json.h
index d2962c322678b0dd664707f34151094fec90d281..f42ba9c135cb76a1b0bc31f9e2c03b1ed7dce749 100644
index 1553eecb7251d509622ab00a4ade4a672252845e..c5f39687e68289adadb988df9cfd81c031266859 100644
--- a/json.h
+++ b/json.h
@@ -96,6 +96,7 @@ class json
public:
static wpi::util::expected<json, const char*> parse(std::string_view);
static std::expected<json, const char*> parse(std::string_view);
+ static json parse_or_throw(std::string_view);
json(const json&);