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
5 changed files with 281 additions and 8 deletions

View File

@@ -316,8 +316,8 @@ TEST_CASE("object inspection")
SECTION("round trips")
{
for (const auto& s :
{"3.141592653589793", "1000000000000000010E5"
})
{"3.141592653589793", "1000000000000000010E5"
})
{
json j1 = json::parse(s);
std::string s1 = j1.dump();