Make the swap() functions noexcept

This commit is contained in:
Gennaro Prota
2025-06-22 18:10:19 +02:00
parent 76656c9a0f
commit 28ddbd7afc
2 changed files with 6 additions and 6 deletions

View File

@@ -146,7 +146,7 @@ public:
<a href=
"#move-cons">dynamic_bitset</a>(dynamic_bitset&amp;&amp; b);
void <a href="#swap">swap</a>(dynamic_bitset&amp; b);
void <a href="#swap">swap</a>(dynamic_bitset&amp; b) noexcept;
dynamic_bitset&amp; <a href=
"#assign">operator=</a>(const dynamic_bitset&amp; b);
@@ -757,7 +757,7 @@ and destroys the bitset object itself.<br />
<hr />
<pre>
void <a id="swap">swap</a>(dynamic_bitset&amp; b);
void <a id="swap">swap</a>(dynamic_bitset&amp; b) noexcept;
</pre>
<b>Effects:</b> The contents of this bitset and bitset <tt>b</tt>

View File

@@ -186,7 +186,7 @@ public:
~dynamic_bitset();
void swap(dynamic_bitset& b);
void swap(dynamic_bitset& b) BOOST_NOEXCEPT;
dynamic_bitset& operator=(const dynamic_bitset& b);
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
@@ -614,7 +614,7 @@ operator-(const dynamic_bitset<Block, Allocator>& b1,
// namespace scope swap
template<typename Block, typename Allocator>
void swap(dynamic_bitset<Block, Allocator>& b1,
dynamic_bitset<Block, Allocator>& b2);
dynamic_bitset<Block, Allocator>& b2) BOOST_NOEXCEPT;
template <typename Block, typename Allocator, typename stringT>
@@ -677,7 +677,7 @@ inline dynamic_bitset<Block, Allocator>::
template <typename Block, typename Allocator>
inline void dynamic_bitset<Block, Allocator>::
swap(dynamic_bitset<Block, Allocator>& b) // no throw
swap(dynamic_bitset<Block, Allocator>& b) BOOST_NOEXCEPT
{
std::swap(m_bits, b.m_bits);
std::swap(m_num_bits, b.m_num_bits);
@@ -1782,7 +1782,7 @@ operator-(const dynamic_bitset<Block, Allocator>& x,
template<typename Block, typename Allocator>
inline void
swap(dynamic_bitset<Block, Allocator>& left,
dynamic_bitset<Block, Allocator>& right) // no throw
dynamic_bitset<Block, Allocator>& right) BOOST_NOEXCEPT
{
left.swap(right);
}