From d397ae4c060b03b6ceb8e281c8f5f42e79ca0da5 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 29 May 2024 08:40:49 +0200 Subject: [PATCH] totally_ordered_wrapper: make default-constructible Pointers are. The default-constructor is = default'ed, meaning it has the same semantics as the raw pointer it replaces: totally_ordered_wrapper p; // partially-formed (uninit'ed) totally_ordered_wrapper p{}; // well-formed (nullptr) totally_ordered_wrapper a[1024]; // doesn't write 8KiB of NULs Change-Id: I0d2e906bc5ec45d95b03a3af451167fec84439fd Reviewed-by: Rym Bouabid Reviewed-by: Ivan Solovev --- src/corelib/global/qcomparehelpers.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/global/qcomparehelpers.h b/src/corelib/global/qcomparehelpers.h index 508da3fcd37..b067cb2c7ea 100644 --- a/src/corelib/global/qcomparehelpers.h +++ b/src/corelib/global/qcomparehelpers.h @@ -619,6 +619,7 @@ class totally_ordered_wrapper P ptr; public: + totally_ordered_wrapper() noexcept = default; explicit constexpr totally_ordered_wrapper(P p) noexcept : ptr(p) {} constexpr P get() const noexcept { return ptr; }