QVariant: de-duplicate customConstructShared()

Commit 3ad9f94ff2 (Feb 2023) moved it to
qvariant_p.h but commit 79ae79d05c
(authored Sep 2022 but committed June 2023) brought it back, probably by
accident due to conflict resolution during rebasing.

For some reason, no compiler in our CI complains about it, but ICX 2023
(based on unrelased Clang versions) did:

variant_p.h(101,23): error: call to 'customConstructShared' is ambiguous

Pick-to: 6.6
Fixes: QTBUG-116496
Change-Id: Ifa1111900d6945ea8e05fffd177eab656a2dc507
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
bb10
Thiago Macieira 2023-08-25 08:56:01 -07:00
parent 7e84a04563
commit bed203a6fc
1 changed files with 0 additions and 16 deletions

View File

@ -245,22 +245,6 @@ enum CustomConstructNullabilityOption {
// future option: AlwaysNull?
};
template <typename F> static QVariant::PrivateShared *
customConstructShared(size_t size, size_t align, F &&construct)
{
struct Deleter {
void operator()(QVariant::PrivateShared *p) const
{ QVariant::PrivateShared::free(p); }
};
// this is exception-safe
std::unique_ptr<QVariant::PrivateShared, Deleter> ptr;
ptr.reset(QVariant::PrivateShared::create(size, align));
construct(ptr->data());
return ptr.release();
}
// the type of d has already been set, but other field are not set
template <CustomConstructMoveOptions moveOption = UseCopy, CustomConstructNullabilityOption nullability = MaybeNull>
static void customConstruct(const QtPrivate::QMetaTypeInterface *iface, QVariant::Private *d,