forked from Ferdi265/cxx-ring-buffer
Merge pull request #2 from rubienr/fix-ring-buffer-iterator-esp-idf
fixes ring-buffer-iterator swap()
This commit is contained in:
@ -93,9 +93,9 @@ public:
|
|||||||
CONSTEXPR friend ring_buffer_iterator operator+( difference_type n, const ring_buffer_iterator& it) NOEXCEPT {
|
CONSTEXPR friend ring_buffer_iterator operator+( difference_type n, const ring_buffer_iterator& it) NOEXCEPT {
|
||||||
return it + n;
|
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;
|
using std::swap;
|
||||||
swap(a.container, b.container);
|
swap(a.container_ptr, b.container_ptr);
|
||||||
swap(a.front, b.front);
|
swap(a.front, b.front);
|
||||||
swap(a.index, b.index);
|
swap(a.index, b.index);
|
||||||
}
|
}
|
||||||
@ -189,9 +189,9 @@ public:
|
|||||||
CONSTEXPR friend ring_buffer_const_iterator operator+( difference_type n, const ring_buffer_const_iterator& it) NOEXCEPT {
|
CONSTEXPR friend ring_buffer_const_iterator operator+( difference_type n, const ring_buffer_const_iterator& it) NOEXCEPT {
|
||||||
return it + n;
|
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;
|
using std::swap;
|
||||||
swap(a.container, b.container);
|
swap(a.container_ptr, b.container_ptr);
|
||||||
swap(a.front, b.front);
|
swap(a.front, b.front);
|
||||||
swap(a.index, b.index);
|
swap(a.index, b.index);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user