Skip to content

Commit c9dc012

Browse files
committed
Support assignment from empty braces
This makes resetting a handle more natural and idiomatic, matching modern C++ expectations without affecting existing semantics. Change-Id: I85e3c2e8b0d4c288d90b1739b83994d345a757ed Reviewed-by: Artem Dyomin <[email protected]>
1 parent 0de3a95 commit c9dc012

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/corelib/tools/quniquehandle_p.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ class QUniqueHandle : private QtPrivate::CompactStorage<Deleter>
193193
static_assert(noexcept(std::declval<Type>() >= std::declval<Type>()));
194194

195195
template <if_default_constructible<Deleter> = true>
196-
explicit QUniqueHandle(const Type& handle = HandleTraits::invalidValue()) noexcept
196+
QUniqueHandle() noexcept
197+
{}
198+
199+
template <if_default_constructible<Deleter> = true>
200+
explicit QUniqueHandle(const Type &handle) noexcept
197201
: m_handle{ handle }
198202
{}
199203

0 commit comments

Comments
 (0)