From 3d06960f83b882749c0803096a4da1bd15fd197d Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 9 Oct 2026 16:11:40 +0200 Subject: [PATCH] Tidy the view serializer: doxygen block placement, enabled() for a constant Signed-off-by: Niels Lohmann --- include/nlohmann/detail/view/serializer.hpp | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/nlohmann/detail/view/serializer.hpp b/include/nlohmann/detail/view/serializer.hpp index c86b00bb4..eeff92851 100644 --- a/include/nlohmann/detail/view/serializer.hpp +++ b/include/nlohmann/detail/view/serializer.hpp @@ -357,16 +357,6 @@ class view_serializer } private: - /*! - @brief the compact output without ensure_ascii (the default dump()) - - The same walk as dump(), with the write position in a local variable - (stores through char pointers would otherwise force a reload of the - buffer's members after each one), and with strings and number tokens of - the source copied by fixed-size moves of 32 bytes where the source has - that many bytes left, instead of a library call per token. The buffer - keeps 64 bytes of slack for the overshoot. - */ /// a string that is not a plain string of the source (decoded, or written /// by an edit), without ensure_ascii: runs without characters to escape /// are copied @@ -405,6 +395,16 @@ class view_serializer return option; } + /*! + @brief the compact output without ensure_ascii (the default dump()) + + The same walk as dump(), with the write position in a local variable + (stores through char pointers would otherwise force a reload of the + buffer's members after each one), and with strings and number tokens of + the source copied by fixed-size moves of 32 bytes where the source has + that many bytes left, instead of a library call per token. The buffer + keeps 64 bytes of slack for the overshoot. + */ template void dump_compact(const node* root) { @@ -526,7 +526,7 @@ class view_serializer room(n->len); copy(src + n->off, n->len); } - else if (std::is_same::value) + else if (enabled(std::is_same::value)) { room(64); w = write_double_at(w, *n);