forked from Ferdi265/cxx-ring-buffer
ring-buffer-iterator: remove unnecessary conditional noexcept
container_ptr is a built-in pointer type, and will always be noexcept to swap.
This commit is contained in:
@ -97,7 +97,7 @@ public:
|
||||
CONSTEXPR friend ring_buffer_iterator operator+(difference_type n, const ring_buffer_iterator& it) NOEXCEPT {
|
||||
return it + n;
|
||||
}
|
||||
CONSTEXPR friend void swap(ring_buffer_iterator& a, ring_buffer_iterator& b) COND_NOEXCEPT(noexcept(std::swap(a.container_ptr, b.container_ptr))) {
|
||||
CONSTEXPR friend void swap(ring_buffer_iterator& a, ring_buffer_iterator& b) NOEXCEPT {
|
||||
using std::swap;
|
||||
swap(a.container_ptr, b.container_ptr);
|
||||
swap(a.front, b.front);
|
||||
@ -197,7 +197,7 @@ public:
|
||||
CONSTEXPR friend ring_buffer_const_iterator operator+(difference_type n, const ring_buffer_const_iterator& it) NOEXCEPT {
|
||||
return it + n;
|
||||
}
|
||||
CONSTEXPR friend void swap(ring_buffer_const_iterator& a, ring_buffer_const_iterator& b) COND_NOEXCEPT(noexcept(std::swap(a.container_ptr, b.container_ptr))) {
|
||||
CONSTEXPR friend void swap(ring_buffer_const_iterator& a, ring_buffer_const_iterator& b) NOEXCEPT {
|
||||
using std::swap;
|
||||
swap(a.container_ptr, b.container_ptr);
|
||||
swap(a.front, b.front);
|
||||
|
Reference in New Issue
Block a user