diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2021-12-13 12:29:51 +0100 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2021-12-17 07:52:40 +0000 |
| commit | 48b4f144e7f690f5ae840124eaad4eaa67a02681 (patch) | |
| tree | 5d7265f145d116ce58ca41472dfc9a76aaf8a373 /src/corelib/tools/qringbuffer.cpp | |
| parent | 38e7b5dcd684df80ea3edbbae236d7bdebf49b8c (diff) | |
QRingBuffer: simplify QRingChunk special member functions [2/2]
Use NSDMI and let the compiler generate the default ctor, too.
Statically assert that it's still noexcept (we marked it as such,
because MSVC still doesn't noexcept(auto) when an SMF is =default'ed.
Simplify the other ctors, too, relying on NSDMI. Keep one instance of
tailOffset(0), in the 'reserving' ctor, because it's inconsistent with
the other ctors which all do tailOffset{chunk.size()}, so it's best to
leave this explicit, lest the next reader wonders whether it was
forgotten.
Pick-to: 6.3
Change-Id: I0d9f91aa5bc89377c4144589df8786b502e956a4
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/tools/qringbuffer.cpp')
| -rw-r--r-- | src/corelib/tools/qringbuffer.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/tools/qringbuffer.cpp b/src/corelib/tools/qringbuffer.cpp index b10362b0cdb..72c56a20f6b 100644 --- a/src/corelib/tools/qringbuffer.cpp +++ b/src/corelib/tools/qringbuffer.cpp @@ -47,6 +47,7 @@ QT_BEGIN_NAMESPACE +static_assert(std::is_nothrow_default_constructible_v<QRingChunk>); static_assert(std::is_nothrow_move_constructible_v<QRingChunk>); static_assert(std::is_nothrow_move_assignable_v<QRingChunk>); |
