mirror of
https://github.com/nlohmann/json.git
synced 2026-07-04 01:34:17 +00:00
Fix ambiguous static_cast (#5221)
* 🐛 fix ambiguous static_cast Signed-off-by: Niels Lohmann <mail@nlohmann.me> * ✅ add regression test Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🐛 fix warning Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 🚨 fix warning Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -881,7 +881,7 @@ class binary_writer
|
||||
for (size_t i = 0; i < j.m_data.m_value.binary->size(); ++i)
|
||||
{
|
||||
oa->write_character(to_char_type(bjdata_draft3 ? 'B' : 'U'));
|
||||
oa->write_character(j.m_data.m_value.binary->data()[i]);
|
||||
oa->write_character(to_char_type(j.m_data.m_value.binary->data()[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1634,7 +1634,9 @@ class binary_writer
|
||||
};
|
||||
|
||||
string_t key = "_ArrayType_";
|
||||
auto it = bjdtype.find(static_cast<string_t>(value.at(key)));
|
||||
// use get<string_t>() instead of static_cast<string_t> to avoid an
|
||||
// ambiguous conversion under explicit instantiation on C++17 (see #4825)
|
||||
auto it = bjdtype.find(value.at(key).template get<string_t>());
|
||||
if (it == bjdtype.end())
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -4302,7 +4302,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
}
|
||||
};
|
||||
|
||||
data m_data = {};
|
||||
data m_data = {}; // NOLINT(readability-redundant-member-init)
|
||||
|
||||
#if JSON_DIAGNOSTICS
|
||||
/// a pointer to a parent value (for debugging purposes)
|
||||
|
||||
Reference in New Issue
Block a user