Fix return value of get_ptr for unsigned integers (#4525)

* 🐛 fix return value of get_ptr for unsigned integers

* 📝 update documentation
This commit is contained in:
Niels Lohmann
2024-12-06 18:38:25 +01:00
committed by GitHub
parent a006a7a48b
commit 9f60e85557
6 changed files with 46 additions and 10 deletions

View File

@@ -215,8 +215,8 @@ TEST_CASE("reference access")
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number", json::type_error&);
CHECK_THROWS_WITH_AS(value.get_ref<json::boolean_t&>(),
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number", json::type_error&);
//CHECK_THROWS_WITH_AS(value.get_ref<json::number_integer_t&>(),
// "[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number", json::type_error&);
CHECK_THROWS_WITH_AS(value.get_ref<json::number_integer_t&>(),
"[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number", json::type_error&);
CHECK_NOTHROW(value.get_ref<json::number_unsigned_t&>());
CHECK_THROWS_WITH_AS(value.get_ref<json::number_float_t&>(), "[json.exception.type_error.303] incompatible ReferenceType for get_ref, actual type is number", json::type_error&);
}