diff --git a/include/rfl/parsing/Parser_optional.hpp b/include/rfl/parsing/Parser_optional.hpp index d4726939..029a897b 100644 --- a/include/rfl/parsing/Parser_optional.hpp +++ b/include/rfl/parsing/Parser_optional.hpp @@ -51,7 +51,8 @@ struct Parser, ProcessorsType> { if constexpr (schemaful::IsSchemafulWriter) { auto u = ParentType::add_union(_w, _parent); using UnionType = typename ParentType::template Union; - auto p = UnionType{.index_ = _o ? 0 : 1, .union_ = &u}; + auto p = + UnionType{.index_ = static_cast(_o ? 0 : 1), .union_ = &u}; if (_o) { Parser, ProcessorsType>::write(_w, *_o, p); } else { diff --git a/include/rfl/parsing/Parser_shared_ptr.hpp b/include/rfl/parsing/Parser_shared_ptr.hpp index 7c45e225..e7dcba02 100644 --- a/include/rfl/parsing/Parser_shared_ptr.hpp +++ b/include/rfl/parsing/Parser_shared_ptr.hpp @@ -49,7 +49,8 @@ struct Parser, ProcessorsType> { if constexpr (schemaful::IsSchemafulWriter) { auto u = ParentType::add_union(_w, _parent); using UnionType = typename ParentType::template Union; - auto p = UnionType{.index_ = _s ? 0 : 1, .union_ = &u}; + auto p = + UnionType{.index_ = static_cast(_s ? 0 : 1), .union_ = &u}; if (_s) { Parser, ProcessorsType>::write(_w, *_s, p); } else { diff --git a/include/rfl/parsing/Parser_unique_ptr.hpp b/include/rfl/parsing/Parser_unique_ptr.hpp index 04869ce0..b9d60587 100644 --- a/include/rfl/parsing/Parser_unique_ptr.hpp +++ b/include/rfl/parsing/Parser_unique_ptr.hpp @@ -50,7 +50,8 @@ struct Parser, ProcessorsType> { if constexpr (schemaful::IsSchemafulWriter) { auto u = ParentType::add_union(_w, _parent); using UnionType = typename ParentType::template Union; - auto p = UnionType{.index_ = _s ? 0 : 1, .union_ = &u}; + auto p = + UnionType{.index_ = static_cast(_s ? 0 : 1), .union_ = &u}; if (_s) { Parser, ProcessorsType>::write(_w, *_s, p); } else {