diff --git a/include/jsoncons/basic_json.hpp b/include/jsoncons/basic_json.hpp index 28aeeeeaf..11fb48a04 100644 --- a/include/jsoncons/basic_json.hpp +++ b/include/jsoncons/basic_json.hpp @@ -3244,7 +3244,7 @@ namespace jsoncons { } template - basic_json(IntegerType val, semantic_tag tag, + basic_json(IntegerType val, semantic_tag tag = semantic_tag::none, typename std::enable_if::value && sizeof(IntegerType) <= sizeof(uint64_t), int>::type = 0) { construct(val, tag); @@ -3313,7 +3313,7 @@ namespace jsoncons { construct(tag); } - basic_json(bool val, semantic_tag tag) + basic_json(bool val, semantic_tag tag = semantic_tag::none) { construct(val,tag); } diff --git a/test/corelib/src/ojson_object_tests.cpp b/test/corelib/src/ojson_object_tests.cpp index 66262ee19..5a7ee074d 100644 --- a/test/corelib/src/ojson_object_tests.cpp +++ b/test/corelib/src/ojson_object_tests.cpp @@ -93,6 +93,7 @@ TEST_CASE("ojson object erase with iterator") CHECK(doc.size() == 1); CHECK(doc.at("b") == 2); CHECK(doc.at("b") == 2.0); + CHECK(doc.at("b") == 2.0f); CHECK(doc["b"] == 2); }