support construction from other basic_json types

Before this patch, `basic_json` types with different template arguments
were treated as `CompatibleArrayType`. Which sometimes leads to recursive
calls and stack overflows.

This patch adds a constructor and a `get` overload to deal with
different `basic_json` types.
This commit is contained in:
Théo DELRIEU committed 2018-02-27 16:48:09 +01:00
1 parent c22f2d41f3
commit 8711ec6034
5 files changed
+281 -8

No files matched your search

+1 -1
View File
@@ -233,7 +233,7 @@ struct is_compatible_complete_type
{
static constexpr bool value =
not std::is_base_of<std::istream, CompatibleCompleteType>::value and
not std::is_same<BasicJsonType, CompatibleCompleteType>::value and
not is_basic_json<CompatibleCompleteType>::value and
not is_basic_json_nested_type<BasicJsonType, CompatibleCompleteType>::value and
has_to_json<BasicJsonType, CompatibleCompleteType>::value;
};