From dc8245e7c87e3dd51894f81ae00ecfd96b6044fc Mon Sep 17 00:00:00 2001 From: Tal Risin Date: Thu, 25 Jun 2026 21:12:10 +0300 Subject: [PATCH] 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_;