mirror of
https://github.com/nlohmann/json.git
synced 2026-10-11 17:07:15 +00:00
Fix old clang and MSVC C4127 in editable json documents
Value-initialize the const std::less in find_parent (clang 3.4/3.6 do not implement DR 253), and test the Editable template argument through a function to avoid MSVC C4127. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+10
-2
No files matched your search
@@ -177,7 +177,7 @@ inline node* block_of(document_data& d, node* n, std::size_t extra)
|
||||
/// still covers its original subtree.
|
||||
inline node* find_parent(const document_data& d, const node* target)
|
||||
{
|
||||
const std::less<const node*> lt;
|
||||
const std::less<const node*> lt{};
|
||||
const node* lo = d.tape;
|
||||
const node* hi = d.tape + d.tape_size;
|
||||
const node* c = d.tape;
|
||||
|
||||
Reference in new issue
Block a user