mirror of
https://github.com/nlohmann/json.git
synced 2026-02-22 11:26:25 +00:00
add a switch to enable implicit conversions (defaults to true)
wrap implicit conversions tests around the JSON_USE_IMPLICIT_CONVERSIONS macro
This commit is contained in:
@@ -312,6 +312,7 @@ TEST_CASE("basic usage" * doctest::test_suite("udt"))
|
||||
CHECK(name.m_val == "new name");
|
||||
}
|
||||
|
||||
#if JSON_USE_IMPLICIT_CONVERSIONS
|
||||
SECTION("implicit conversions")
|
||||
{
|
||||
const udt::contact_book parsed_book = big_json;
|
||||
@@ -335,6 +336,7 @@ TEST_CASE("basic usage" * doctest::test_suite("udt"))
|
||||
CHECK(book_name == udt::name{"C++"});
|
||||
CHECK(book == parsed_book);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user