[network/libktorrent] src/util: Add missing noexcept to move constructor and assignment operator
Jack Hill <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 2ca157f625ce09839b5db062865726be9fa3ef0c by Jack Hill.
Committed on 01/08/2026 at 11:07.
Pushed by jackh into branch 'master'.
Add missing noexcept to move constructor and assignment operator
M +2 -2 src/util/bitset.cpp
M +2 -2 src/util/bitset.h
https://invent.kde.org/network/libktorrent/-/commit/2ca157f625ce09839b5db062865726be9fa3ef0c
diff --git a/src/util/bitset.cpp b/src/util/bitset.cpp
index c695f780..6bd066f3 100644
--- a/src/util/bitset.cpp
+++ b/src/util/bitset.cpp
@@ -35,7 +35,7 @@ BitSet::BitSet(const Uint8 *d, Uint32 num_bits)
updateNumOnBits();
}
-BitSet::BitSet(BitSet &&bs)
+BitSet::BitSet(BitSet &&bs) noexcept
: num_bits(std::exchange(bs.num_bits, 0))
, data(std::move(bs.data))
, num_on(std::exchange(bs.num_on, 0))
@@ -52,7 +52,7 @@ void BitSet::updateNumOnBits()
}
}
-BitSet &BitSet::operator=(BitSet &&bs)
+BitSet &BitSet::operator=(BitSet &&bs) noexcept
{
num_bits = std::exchange(bs.num_bits, 0);
data = std::move(bs.data);
diff --git a/src/util/bitset.h b/src/util/bitset.h
index 758a50d2..9108218f 100644
--- a/src/util/bitset.h
+++ b/src/util/bitset.h
@@ -53,7 +53,7 @@ public:
* Move constructor.
* \param bs BitSet to move
*/
- BitSet(BitSet &&bs);
+ BitSet(BitSet &&bs) noexcept;
/*!
* Destructor
@@ -145,7 +145,7 @@ public:
* \param bs BitSet to move
* \return *this
*/
- BitSet &operator=(BitSet &&bs);
+ BitSet &operator=(BitSet &&bs) noexcept;
/*!
* Subtraction assignment operator.