From 248d4eb2aa9e7bcee5c41dbb42fa7237d5bac262 Mon Sep 17 00:00:00 2001 From: Francisco Geiman Thiesen Date: Sun, 3 Aug 2025 18:12:50 +0000 Subject: [PATCH] Try using parentheses instead of braces for document initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The issue might be related to how brace initialization vs parentheses initialization handles implicit conversion from simdjson_result to document. This could be compiler-specific behavior. Using parentheses initialization to ensure the conversion operator is called properly. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- include/simdjson/convert.h | 10 ++-------- singleheader/simdjson.cpp | 2 +- singleheader/simdjson.h | 12 +++--------- singleheader/singleheader.zip | Bin 8089583 -> 8089401 bytes 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/include/simdjson/convert.h b/include/simdjson/convert.h index 792e1d708..943b1244f 100644 --- a/include/simdjson/convert.h +++ b/include/simdjson/convert.h @@ -106,10 +106,7 @@ public: explicit auto_parser(ParserType &&parser, padded_string_view const str) noexcept requires(!std::is_pointer_v) - : m_parser{std::move(parser)}, m_doc{} { - // Initialize m_doc after m_parser is ready - m_doc = std::move(m_parser.iterate(str).value_unsafe()); - } + : m_parser{std::move(parser)}, m_doc(m_parser.iterate(str)) {} explicit auto_parser(padded_string_view const str) noexcept requires(!std::is_pointer_v) @@ -124,10 +121,7 @@ public: explicit auto_parser(std::remove_pointer_t &parser, padded_string_view const str) noexcept requires(std::is_pointer_v) - : m_parser{&parser}, m_doc{} { - // Initialize m_doc after m_parser is ready - m_doc = std::move(parser.iterate(str).value_unsafe()); - } + : m_parser{&parser}, m_doc(parser.iterate(str)) {} explicit auto_parser(ParserType parser, ondemand::document &&doc) noexcept requires(std::is_pointer_v) diff --git a/singleheader/simdjson.cpp b/singleheader/simdjson.cpp index ddb7af79b..e414e8a8f 100644 --- a/singleheader/simdjson.cpp +++ b/singleheader/simdjson.cpp @@ -1,4 +1,4 @@ -/* auto-generated on 2025-08-03 06:01:50 +0000. Do not edit! */ +/* auto-generated on 2025-08-03 15:28:40 +0000. Do not edit! */ /* including simdjson.cpp: */ /* begin file simdjson.cpp */ #define SIMDJSON_SRC_SIMDJSON_CPP diff --git a/singleheader/simdjson.h b/singleheader/simdjson.h index 6b424b63f..43e45f31a 100644 --- a/singleheader/simdjson.h +++ b/singleheader/simdjson.h @@ -1,4 +1,4 @@ -/* auto-generated on 2025-08-03 06:01:50 +0000. Do not edit! */ +/* auto-generated on 2025-08-03 15:28:40 +0000. Do not edit! */ /* including simdjson.h: */ /* begin file simdjson.h */ #ifndef SIMDJSON_H @@ -135358,10 +135358,7 @@ public: explicit auto_parser(ParserType &&parser, padded_string_view const str) noexcept requires(!std::is_pointer_v) - : m_parser{std::move(parser)}, m_doc{} { - // Initialize m_doc after m_parser is ready - m_doc = std::move(m_parser.iterate(str).value_unsafe()); - } + : m_parser{std::move(parser)}, m_doc(m_parser.iterate(str)) {} explicit auto_parser(padded_string_view const str) noexcept requires(!std::is_pointer_v) @@ -135376,10 +135373,7 @@ public: explicit auto_parser(std::remove_pointer_t &parser, padded_string_view const str) noexcept requires(std::is_pointer_v) - : m_parser{&parser}, m_doc{} { - // Initialize m_doc after m_parser is ready - m_doc = std::move(parser.iterate(str).value_unsafe()); - } + : m_parser{&parser}, m_doc(parser.iterate(str)) {} explicit auto_parser(ParserType parser, ondemand::document &&doc) noexcept requires(std::is_pointer_v) diff --git a/singleheader/singleheader.zip b/singleheader/singleheader.zip index 4fabd74c3c7df249415958898f5ff1ed01716a33..60d178f19e31492f0757a7740e3b4bb28f558de4 100644 GIT binary patch delta 639 zcmZwF%T7}P6op~rAm9zPg0=OATD0|2X$7st3wW2JvJ_Cjibt)A2*uMX;7Lpz>^Nf3 zQQv^M1JW3uKqtO|+6N%M0)Gcgh&%a4dk(`zM0YxwN_TyhX@jZWR-CR4L%lWDVQi)pKAo2kXL-L%8B(-bi6GPRo8 zOuJ1%(;idE6gKTO?KAB+9WWg-84TbK?&2N>A>79U3}F}}c!)|J+=op+6(p^DsV!Ki;1`) zVbwR_4NT($_zterJ^;}NFwrlPZrqtT$>*P0%p||Xe?ER$^L_ui=JUsgd^Igq>-FCA zjW5Ngy%m2?eY86k?TB@~6_rgY)ha%f8kJg=I+c2r29?b!jVfDIwyJDXX;Nuc*{-rf z#jmncrA1|z%5If_N~_8qmAxwaRQ9VJP&ue_NX1Y&ta3!<=m%*le`{JIL;L5SzXHo6 zRe|MVf4MDM$+9AmcdO+#9K&&(KoB9E#3{7nG{RV)kD>#eID@n3LO0H#2j>w(FD{@D z7jX&wxQr_pz*Stsb=<&B4B{4sa2t0pjJt?Ka1ZzK01q*OM;OHz9%CF6c!H-$;2BIj zM-nMmn8XyOVdDi}B8?2P$YBPrkcR^ovnb#-<}hDcEiVM--gt|K*Jx0Yh%uP8UE56C z3zm^dq;g5aoOG=`{fwD+Xl%#GTV`th&-}(jpW(QvSS*t(Si#C%*k;Rgt)S!PL*as% zp0yIQS;w5Tf}v0^%ZrUX*4#|mP8J78z2?%7F>j#ye@58|{4YUlw>UKFwU%-d-mt%+ Xau&r;S+Dc&4_ce^!gW(QkMsErMU!+<