QGIM: simplify MultiColumn's get<> implementation
Use the refTo helper to unify pointer/reference/value handling. Change-Id: Ib4d1f142ffd47b843d42cabfbbab82f644d98125 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
424d6ebf13
commit
1f5fc537c1
@ -36,11 +36,7 @@ public:
|
|||||||
friend inline decltype(auto) get(V &&multiColumn)
|
friend inline decltype(auto) get(V &&multiColumn)
|
||||||
{
|
{
|
||||||
static_assert(I < std::tuple_size_v<type>, "Index out of bounds for wrapped type");
|
static_assert(I < std::tuple_size_v<type>, "Index out of bounds for wrapped type");
|
||||||
Q_ASSERT(multiColumn);
|
return get<I>(QGenericItemModelDetails::refTo(q23::forward_like<V>(multiColumn.data)));
|
||||||
if constexpr (std::is_pointer_v<T>)
|
|
||||||
return get<I>(*multiColumn.data);
|
|
||||||
else
|
|
||||||
return get<I>(q23::forward_like<V>(multiColumn.data));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user