diff --git a/src/corelib/tools/qringbuffer.cpp b/src/corelib/tools/qringbuffer.cpp index f32673b9bd7..b10362b0cdb 100644 --- a/src/corelib/tools/qringbuffer.cpp +++ b/src/corelib/tools/qringbuffer.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Copyright (C) 2015 Alex Trotsenko ** Contact: https://www.qt.io/licensing/ ** @@ -40,10 +40,16 @@ #include "private/qringbuffer_p.h" #include "private/qbytearray_p.h" + +#include + #include QT_BEGIN_NAMESPACE +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); + void QRingChunk::allocate(qsizetype alloc) { Q_ASSERT(alloc > 0 && size() == 0); diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h index 1ab0053d1ac..84e0f9ddec5 100644 --- a/src/corelib/tools/qringbuffer_p.h +++ b/src/corelib/tools/qringbuffer_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -69,10 +69,6 @@ public: headOffset(0), tailOffset(0) { } - inline QRingChunk(const QRingChunk &other) noexcept : - chunk(other.chunk), headOffset(other.headOffset), tailOffset(other.tailOffset) - { - } explicit inline QRingChunk(qsizetype alloc) : chunk(alloc, Qt::Uninitialized), headOffset(0), tailOffset(0) { @@ -86,20 +82,6 @@ public: { } - inline QRingChunk &operator=(const QRingChunk &other) noexcept - { - chunk = other.chunk; - headOffset = other.headOffset; - tailOffset = other.tailOffset; - return *this; - } - inline QRingChunk(QRingChunk &&other) noexcept : - chunk(other.chunk), headOffset(other.headOffset), tailOffset(other.tailOffset) - { - other.headOffset = other.tailOffset = 0; - } - QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QRingChunk) - inline void swap(QRingChunk &other) noexcept { chunk.swap(other.chunk);