mirror of
https://github.com/nlohmann/json.git
synced 2026-02-24 12:26:25 +00:00
Fix 'const' qualifier on bool& has no effect (#3678)
* Fix 'const' qualifier on bool& has no effect Thanks, @georgthegreat, for pointing out this issue. * Extend std::vector<bool> unit test
This commit is contained in:
committed by
GitHub
parent
bfbe774d8f
commit
f1e34070d2
@@ -454,10 +454,19 @@ TEST_CASE("constructors")
|
||||
CHECK(j.type() == json::value_t::boolean);
|
||||
}
|
||||
|
||||
SECTION("from std::vector<bool>::refrence")
|
||||
SECTION("from std::vector<bool>::reference")
|
||||
{
|
||||
std::vector<bool> v{true};
|
||||
json j(v[0]);
|
||||
CHECK(std::is_same<decltype(v[0]), std::vector<bool>::reference>::value);
|
||||
CHECK(j.type() == json::value_t::boolean);
|
||||
}
|
||||
|
||||
SECTION("from std::vector<bool>::const_reference")
|
||||
{
|
||||
const std::vector<bool> v{true};
|
||||
json j(v[0]);
|
||||
CHECK(std::is_same<decltype(v[0]), std::vector<bool>::const_reference>::value);
|
||||
CHECK(j.type() == json::value_t::boolean);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user