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 2018-02-27 12:11:04 +01:00
parent c22f2d41f3
commit 8711ec6034
No known key found for this signature in database
GPG key ID: 7D6E00D1DF01DEAF
5 changed files with 281 additions and 8 deletions

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;
};