0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd::json::tuple: Tweak the assignment suite to possibly fix issues with nested tuples.

This commit is contained in:
Jason Volk 2019-03-06 13:28:02 -08:00
parent b534939016
commit 1e55e56b05

View file

@ -113,7 +113,22 @@ template<class dst,
class src>
typename std::enable_if
<
ircd::json::is_tuple<dst>(),
ircd::json::is_tuple<dst>() &&
std::is_assignable<dst, src>(),
void>::type
_assign(dst &d,
src&& s)
{
d = std::forward<src>(s);
}
template<class dst,
class src>
typename std::enable_if
<
ircd::json::is_tuple<dst>() &&
!std::is_assignable<dst, src>() &&
std::is_constructible<dst, src>(),
void>::type
_assign(dst &d,
src&& s)
@ -121,6 +136,20 @@ _assign(dst &d,
d = dst{std::forward<src>(s)};
}
template<class dst,
class src>
typename std::enable_if
<
ircd::json::is_tuple<dst>() &&
!std::is_assignable<dst, src>() &&
!std::is_constructible<dst, src>(),
void>::type
__attribute__((error("Unhandled assignment to json::tuple property")))
_assign(dst &d,
src&& s)
{
}
template<class V,
class... T>
tuple<T...> &