From fda725f9e9b14a57d06e70a8357b1303d2afa711 Mon Sep 17 00:00:00 2001 From: Tal Risin Date: Thu, 25 Jun 2026 21:12:10 +0300 Subject: [PATCH 1/2] fix(c++): replace deprecated std::aligned_storage `std::aligned_storage` is marked as deprecated in c++23, replaced it with an aligned `std::byte` array. * `std::byte` is available since c++17 - the minimum supported version by fory. * `alignas` is available since c++11 --- cpp/fory/util/result.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cpp/fory/util/result.h b/cpp/fory/util/result.h index 0fa5c91bad..3b326f4579 100644 --- a/cpp/fory/util/result.h +++ b/cpp/fory/util/result.h @@ -321,8 +321,9 @@ template class Result { /// ``` template class Result { private: - using ErrorStorage = - typename std::aligned_storage::type; + using ErrorStorage = struct alignas(E) { + std::byte data[sizeof(E)]; + }; ErrorStorage error_storage_; bool has_value_; From cfd3227128ce13869f40a9edc22bc27223b7d45a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E7=99=BD?= Date: Mon, 29 Jun 2026 10:38:36 +0800 Subject: [PATCH 2/2] fix(c++): include cstddef for result storage --- cpp/fory/util/result.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/fory/util/result.h b/cpp/fory/util/result.h index 3b326f4579..96ca5009ef 100644 --- a/cpp/fory/util/result.h +++ b/cpp/fory/util/result.h @@ -22,6 +22,7 @@ #include "fory/util/error.h" #include "fory/util/logging.h" #include "fory/util/macros.h" +#include #include #include #include