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:
parent
b534939016
commit
1e55e56b05
1 changed files with 30 additions and 1 deletions
|
@ -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...> &
|
||||
|
|
Loading…
Reference in a new issue