1
0
mirror of https://github.com/nlohmann/json.git synced 2026-07-21 19:23:03 +04:00

meta: fix is_compatible/constructible traits (#3020)

The previous version relied on the existence of an 'iterator' type.

As mentioned in comments, this is not the proper way to do it and
causes issues with certain types (e.g. views from range-v3).

Add a 'is_range' trait that properly detects the return type of
'begin'/'end', and use it in instead.
This commit is contained in:
Théo DELRIEU
2021-10-07 12:32:25 +02:00
committed by GitHub
parent 62f2997b79
commit 80df5e8de6
7 changed files with 321 additions and 132 deletions
@@ -0,0 +1,8 @@
#pragma once
#include <nlohmann/detail/macro_scope.hpp>
namespace nlohmann
{
NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end);
} // namespace nlohmann