Add to_json() for std::vector<bool>::reference (#3534)

This commit is contained in:
Florian Albrechtskirchinger
2022-06-13 13:21:55 +02:00
committed by GitHub
parent af34396129
commit 9c31d54389
3 changed files with 21 additions and 0 deletions

View File

@@ -474,6 +474,13 @@ TEST_CASE("constructors")
json j(false);
CHECK(j.type() == json::value_t::boolean);
}
SECTION("from std::vector<bool>::refrence")
{
std::vector<bool> v{true};
json j(v[0]);
CHECK(j.type() == json::value_t::boolean);
}
}
SECTION("create a binary (explicit)")