QNativeIpcKey: add implicit default ctor

Add an implicitly callable default ctor, to enable default returns,
but still disallow implicit conversion whilst assigning:

  QNativeIpcKey k = QNativeIpcKey::Type::~~      // not allowed
  auto fn = []() -> QNativeIpcKey { return {}; } // allowed

Change-Id: I0f8476a588b3931f0e1f41a6c3a3fd8f2eb75b93
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 08605f0d7848533bd62b9114dd0e5b175dd00aa3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Dennis Oberst 2023-07-12 16:51:26 +02:00 committed by Qt Cherry-pick Bot
parent 8783783cfc
commit b2004620bd

View File

@ -37,7 +37,11 @@ public:
;
static Type legacyDefaultTypeForOs() noexcept;
explicit constexpr QNativeIpcKey(Type type = DefaultTypeForOs) noexcept
constexpr QNativeIpcKey() noexcept
: QNativeIpcKey(DefaultTypeForOs)
{}
explicit constexpr QNativeIpcKey(Type type) noexcept
: d()
{
typeAndFlags.type = type;