From 3c38455c7d0de77283b9e47931d04d8c755430ae Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 10:35:13 +0000 Subject: [PATCH] BSON writer: drop the SFINAE guard that Visual Studio 2017 cannot deduce write_bson_document_single_pass() was a member template enabled by is_detected. MSVC 19.16 (Visual Studio 2017) fails to deduce it through the class-scope alias template (C2672, C2783) when it compiles to_bson() and to_bon8(), so every Visual Studio 2017 job on AppVeyor fails since #5979. The guard is not needed: as a non-template member of the class template, the function is only instantiated when called, and its only caller is the write_bson_document() overload for sinks that have written(), which already calls oa.written() and oa.rewind() itself. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01N5NasAgbDGG28MqXjQvLqp Signed-off-by: Claude --- include/nlohmann/detail/output/binary_writer.hpp | 1 - single_include/nlohmann/json.hpp | 1 - 2 files changed, 2 deletions(-) diff --git a/include/nlohmann/detail/output/binary_writer.hpp b/include/nlohmann/detail/output/binary_writer.hpp index 0c3c823ac..c9bdc696f 100644 --- a/include/nlohmann/detail/output/binary_writer.hpp +++ b/include/nlohmann/detail/output/binary_writer.hpp @@ -2422,7 +2422,6 @@ class binary_writer nothing large has been written then, and the caller writes the document in two passes, which reports that error */ - template::value, int>::type = 0> bool write_bson_document_single_pass(const BasicJsonType& document) { const std::size_t start = oa.written(); diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 693320ed5..2a7289203 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -30394,7 +30394,6 @@ class binary_writer nothing large has been written then, and the caller writes the document in two passes, which reports that error */ - template::value, int>::type = 0> bool write_bson_document_single_pass(const BasicJsonType& document) { const std::size_t start = oa.written();