From d11e94f2a5d0d8f2b8aaef4d2bea945b3c723457 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Tue, 26 Aug 2025 14:35:43 +0200 Subject: [PATCH 1/2] make read_one_alternative more general MSVC 17.14 did not pick up the move assignment here and was complaining about a missing copy assignment operator in std::optional. Using emplace fixes the issue for me. --- include/rfl/parsing/Parser_variant.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rfl/parsing/Parser_variant.hpp b/include/rfl/parsing/Parser_variant.hpp index dbe1a55b..7df692b1 100644 --- a/include/rfl/parsing/Parser_variant.hpp +++ b/include/rfl/parsing/Parser_variant.hpp @@ -214,7 +214,7 @@ class Parser, ProcessorsType> { std::remove_cvref_t>; auto res = Parser::read(_r, _var); if (res) { - *_result = std::move(*res); + _result->emplace(std::variant{std::move(*res)}); } else { _errors->emplace_back(std::move(res.error())); } From e13422f8d37b64520ba9fb45bad6150a1848fd25 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Tue, 26 Aug 2025 14:39:28 +0200 Subject: [PATCH 2/2] aimplify emplace call in std::variant parser Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- include/rfl/parsing/Parser_variant.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rfl/parsing/Parser_variant.hpp b/include/rfl/parsing/Parser_variant.hpp index 7df692b1..41218df1 100644 --- a/include/rfl/parsing/Parser_variant.hpp +++ b/include/rfl/parsing/Parser_variant.hpp @@ -214,7 +214,7 @@ class Parser, ProcessorsType> { std::remove_cvref_t>; auto res = Parser::read(_r, _var); if (res) { - _result->emplace(std::variant{std::move(*res)}); + _result->emplace(std::move(*res)); } else { _errors->emplace_back(std::move(res.error())); }