@@ -253,7 +253,9 @@ error_code tag_invoke(deserialize_tag, auto &val, T &out) noexcept(nothrow_deser
253253 using value_type = typename std::remove_cvref_t <T>::value_type;
254254
255255 // Check if the value is null
256- if (val.is_null ()) {
256+ bool is_null_value;
257+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
258+ if (is_null_value) {
257259 out.reset (); // Set to nullopt
258260 return SUCCESS;
259261 }
@@ -361,7 +363,9 @@ error_code tag_invoke(deserialize_tag, simdjson_value &val, std::shared_ptr<T> &
361363// Unique pointers
362364// //////////////////////////////////////
363365error_code tag_invoke (deserialize_tag, auto &val, std::unique_ptr<bool > &out) noexcept {
364- if (val.is_null ()) {
366+ bool is_null_value;
367+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
368+ if (is_null_value) {
365369 out.reset ();
366370 return SUCCESS;
367371 }
@@ -374,7 +378,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<bool> &out) no
374378}
375379
376380error_code tag_invoke (deserialize_tag, auto &val, std::unique_ptr<int64_t > &out) noexcept {
377- if (val.is_null ()) {
381+ bool is_null_value;
382+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
383+ if (is_null_value) {
378384 out.reset ();
379385 return SUCCESS;
380386 }
@@ -387,7 +393,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<int64_t> &out)
387393}
388394
389395error_code tag_invoke (deserialize_tag, auto &val, std::unique_ptr<uint64_t > &out) noexcept {
390- if (val.is_null ()) {
396+ bool is_null_value;
397+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
398+ if (is_null_value) {
391399 out.reset ();
392400 return SUCCESS;
393401 }
@@ -400,7 +408,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<uint64_t> &out
400408}
401409
402410error_code tag_invoke (deserialize_tag, auto &val, std::unique_ptr<double > &out) noexcept {
403- if (val.is_null ()) {
411+ bool is_null_value;
412+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
413+ if (is_null_value) {
404414 out.reset ();
405415 return SUCCESS;
406416 }
@@ -413,7 +423,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<double> &out)
413423}
414424
415425error_code tag_invoke (deserialize_tag, auto &val, std::unique_ptr<std::string_view> &out) noexcept {
416- if (val.is_null ()) {
426+ bool is_null_value;
427+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
428+ if (is_null_value) {
417429 out.reset ();
418430 return SUCCESS;
419431 }
@@ -430,7 +442,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<std::string_vi
430442// Shared pointers
431443// //////////////////////////////////////
432444error_code tag_invoke (deserialize_tag, auto &val, std::shared_ptr<bool > &out) noexcept {
433- if (val.is_null ()) {
445+ bool is_null_value;
446+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
447+ if (is_null_value) {
434448 out.reset ();
435449 return SUCCESS;
436450 }
@@ -443,7 +457,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<bool> &out) no
443457}
444458
445459error_code tag_invoke (deserialize_tag, auto &val, std::shared_ptr<int64_t > &out) noexcept {
446- if (val.is_null ()) {
460+ bool is_null_value;
461+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
462+ if (is_null_value) {
447463 out.reset ();
448464 return SUCCESS;
449465 }
@@ -456,7 +472,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<int64_t> &out)
456472}
457473
458474error_code tag_invoke (deserialize_tag, auto &val, std::shared_ptr<uint64_t > &out) noexcept {
459- if (val.is_null ()) {
475+ bool is_null_value;
476+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
477+ if (is_null_value) {
460478 out.reset ();
461479 return SUCCESS;
462480 }
@@ -469,7 +487,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<uint64_t> &out
469487}
470488
471489error_code tag_invoke (deserialize_tag, auto &val, std::shared_ptr<double > &out) noexcept {
472- if (val.is_null ()) {
490+ bool is_null_value;
491+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
492+ if (is_null_value) {
473493 out.reset ();
474494 return SUCCESS;
475495 }
@@ -482,7 +502,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<double> &out)
482502}
483503
484504error_code tag_invoke (deserialize_tag, auto &val, std::shared_ptr<std::string_view> &out) noexcept {
485- if (val.is_null ()) {
505+ bool is_null_value;
506+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
507+ if (is_null_value) {
486508 out.reset ();
487509 return SUCCESS;
488510 }
@@ -504,7 +526,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<std::string_vi
504526// //////////////////////////////////////
505527error_code tag_invoke (deserialize_tag, auto &val, std::unique_ptr<std::string> &out) noexcept {
506528 // Check if the value is null
507- if (val.is_null ()) {
529+ bool is_null_value;
530+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
531+ if (is_null_value) {
508532 out.reset (); // Set to nullptr
509533 return SUCCESS;
510534 }
@@ -520,7 +544,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<std::string> &
520544
521545error_code tag_invoke (deserialize_tag, auto &val, std::shared_ptr<std::string> &out) noexcept {
522546 // Check if the value is null
523- if (val.is_null ()) {
547+ bool is_null_value;
548+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
549+ if (is_null_value) {
524550 out.reset (); // Set to nullptr
525551 return SUCCESS;
526552 }
@@ -536,7 +562,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<std::string> &
536562
537563error_code tag_invoke (deserialize_tag, auto &val, std::unique_ptr<int > &out) noexcept {
538564 // Check if the value is null
539- if (val.is_null ()) {
565+ bool is_null_value;
566+ SIMDJSON_TRY ( val.is_null ().get (is_null_value) );
567+ if (is_null_value) {
540568 out.reset (); // Set to nullptr
541569 return SUCCESS;
542570 }
0 commit comments