🐛 fix returning reference to local temporary object #2064

This commit is contained in:
Niels Lohmann committed 2020-04-27 14:43:49 +02:00
1 parent d9d1279a94
commit 9e0180b698
3 files changed
+25 -1

No files matched your search

+12
View File
@@ -2757,6 +2757,18 @@ class basic_json
return is_binary() ? m_value.binary : nullptr;
}
/// get a pointer to the value (binary)
internal_binary_t* get_impl_ptr(internal_binary_t* /*unused*/) noexcept
{
return is_binary() ? m_value.binary : nullptr;
}
/// get a pointer to the value (binary)
constexpr const internal_binary_t* get_impl_ptr(const internal_binary_t* /*unused*/) const noexcept
{
return is_binary() ? m_value.binary : nullptr;
}
/*!
@brief helper function to implement get_ref()