This commit is contained in:
Alexander Lanin 2024-01-28 16:25:47 -07:00 committed by GitHub
commit 642cef9c7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -1798,6 +1798,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
ValueType & get_to(ValueType& v) const noexcept(noexcept(
JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), v)))
{
static_assert(!std::is_const<ValueType>::value, "Cannot deserialize into constant fields");
JSONSerializer<ValueType>::from_json(*this, v);
return v;
}

View File

@ -21101,6 +21101,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
ValueType & get_to(ValueType& v) const noexcept(noexcept(
JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), v)))
{
static_assert(!std::is_const<ValueType>::value, "Cannot deserialize into constant fields");
JSONSerializer<ValueType>::from_json(*this, v);
return v;
}