mirror of
https://github.com/Ferdi265/cxx-ring-buffer.git
synced 2025-07-30 07:37:16 +02:00
fixes ring-buffer-iterator swap()
This commit is contained in:
@ -97,9 +97,9 @@ 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, b.container))) {
|
||||
CONSTEXPR friend void swap(ring_buffer_iterator& a, ring_buffer_iterator& b) COND_NOEXCEPT(noexcept(std::swap(a.container_ptr, b.container_ptr))) {
|
||||
using std::swap;
|
||||
swap(a.container, b.container);
|
||||
swap(a.container_ptr, b.container_ptr);
|
||||
swap(a.front, b.front);
|
||||
swap(a.index, b.index);
|
||||
}
|
||||
@ -197,9 +197,9 @@ 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, b.container))) {
|
||||
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))) {
|
||||
using std::swap;
|
||||
swap(a.container, b.container);
|
||||
swap(a.container_ptr, b.container_ptr);
|
||||
swap(a.front, b.front);
|
||||
swap(a.index, b.index);
|
||||
}
|
||||
|
Reference in New Issue
Block a user