Add restriction for tuple specialization of to_json

This commit fix the issue 

Signed-off-by: Camille Bégué <c.begue@samsung.com>
This commit is contained in:
Camille Bégué 2019-10-31 18:39:01 +01:00
parent 3790bd9ae0
commit 8b686b30eb
4 changed files with 38 additions and 6 deletions

View file

@ -1842,6 +1842,12 @@ TEST_CASE("regression tests")
static_assert(!std::is_constructible<json, std::pair<NotSerializableData, std::string>>::value, "");
static_assert(std::is_constructible<json, std::pair<int, std::string>>::value, "");
}
SECTION("issue #1825 - A tuple<Args..> is json constructible only if all T in Args are json constructible")
{
static_assert(!std::is_constructible<json, std::tuple<std::string, NotSerializableData>>::value, "");
static_assert(!std::is_constructible<json, std::tuple<NotSerializableData, std::string>>::value, "");
static_assert(std::is_constructible<json, std::tuple<int, std::string>>::value, "");
}
}
#if not defined(JSON_NOEXCEPTION)