mirror of
https://github.com/nlohmann/json.git
synced 2026-07-12 05:25:09 +00:00
Fix clang-tidy hicpp-named-parameter and misc-const-correctness
- Drop the unused reversed-order operator!= overload from utils::istreambuf_sentinel (only iterator != sentinel is ever evaluated) and name the remaining friend's sentinel parameter, fixing hicpp-named-parameter/readability-named-parameter. - Mark the istreambuf_iterator first/last helper variable const in the five binary-format sentinel tests, fixing misc-const-correctness. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -1925,7 +1925,7 @@ TEST_CASE("Parse CBOR directly from a file using iterator and sentinel")
|
||||
{
|
||||
std::string const filename = TEST_DATA_DIRECTORY "/json_testsuite/sample.json.cbor";
|
||||
std::ifstream file(filename, std::ios::binary);
|
||||
std::istreambuf_iterator<char> first(file);
|
||||
const std::istreambuf_iterator<char> first(file);
|
||||
const json parsed = json::from_cbor(first, utils::istreambuf_sentinel{});
|
||||
CHECK((parsed.is_object() || parsed.is_array()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user