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

Pick-to: 6.6
Change-Id: I0f8476a588b3931f0e1f41a6c3a3fd8f2eb75b93
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
bb10
Dennis Oberst 2023-07-12 16:51:26 +02:00
parent ba95594ea2
commit 08605f0d78
1 changed files with 5 additions and 1 deletions

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;