From adf78d3a761381f1633129dc6f69e40fbd4120cf Mon Sep 17 00:00:00 2001 From: "Cosmin D." Date: Tue, 30 Jun 2026 04:33:18 -0700 Subject: [PATCH] Minor: unique_ptr template resolution workaround for MSVC (#5215) Signed-off-by: drcosmin --- include/nlohmann/json.hpp | 2 +- single_include/nlohmann/json.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 5e44e8d70..fefc750fd 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -400,7 +400,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec }; std::unique_ptr obj(AllocatorTraits::allocate(alloc, 1), deleter); AllocatorTraits::construct(alloc, obj.get(), std::forward(args)...); - JSON_ASSERT(obj != nullptr); + JSON_ASSERT(obj); return obj.release(); } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 07366543e..0e23b09a6 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -20918,7 +20918,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec }; std::unique_ptr obj(AllocatorTraits::allocate(alloc, 1), deleter); AllocatorTraits::construct(alloc, obj.get(), std::forward(args)...); - JSON_ASSERT(obj != nullptr); + JSON_ASSERT(obj); return obj.release(); }