mirror of
https://github.com/nlohmann/json.git
synced 2026-02-17 09:03:58 +00:00
Fix conversion to std::optional (#5052)
* 🐛 fix conversion to std::optional 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:
@@ -53,7 +53,8 @@ inline void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
|
||||
}
|
||||
|
||||
#ifdef JSON_HAS_CPP_17
|
||||
template<typename BasicJsonType, typename T>
|
||||
template < typename BasicJsonType, typename T,
|
||||
typename std::enable_if < !nlohmann::detail::is_basic_json<T>::value, int >::type = 0 >
|
||||
void from_json(const BasicJsonType& j, std::optional<T>& opt)
|
||||
{
|
||||
if (j.is_null())
|
||||
|
||||
Reference in New Issue
Block a user