Skip to content

Commit 57a6351

Browse files
committed
Remove code duplication from cbegin/cend.
1 parent 8e23f42 commit 57a6351

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/boost/circular_buffer/base.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ private empty_value<Alloc>
287287
*/
288288
const_iterator begin() const BOOST_NOEXCEPT { return const_iterator(this, empty() ? 0 : m_first); }
289289

290-
const_iterator cbegin() const BOOST_NOEXCEPT { return const_iterator(this, empty() ? 0 : m_first); }
290+
const_iterator cbegin() const BOOST_NOEXCEPT { return begin(); }
291291
//! Get the const iterator pointing to the end of the <code>circular_buffer</code>.
292292
/*!
293293
\return A const random access iterator pointing to the element "one behind" the last element of the <code>
@@ -304,7 +304,7 @@ private empty_value<Alloc>
304304
*/
305305
const_iterator end() const BOOST_NOEXCEPT { return const_iterator(this, 0); }
306306

307-
const_iterator cend() const BOOST_NOEXCEPT { return const_iterator(this, 0); }
307+
const_iterator cend() const BOOST_NOEXCEPT { return end(); }
308308
//! Get the iterator pointing to the beginning of the "reversed" <code>circular_buffer</code>.
309309
/*!
310310
\return A reverse random access iterator pointing to the last element of the <code>circular_buffer</code>.

0 commit comments

Comments
 (0)