Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84971 - trunk/boost/circular_buffer
From: vicente.botet_at_[hidden]
Date: 2013-07-07 08:59:57


Author: viboes
Date: 2013-07-07 08:59:57 EDT (Sun, 07 Jul 2013)
New Revision: 84971
URL: http://svn.boost.org/trac/boost/changeset/84971

Log:
CircularBuffer: manage with #5362, #7025, #7050.

Text files modified:
   trunk/boost/circular_buffer/base.hpp | 14 ++++++--------
   trunk/boost/circular_buffer/details.hpp | 12 ++++++++++++
   trunk/boost/circular_buffer/space_optimized.hpp | 4 ++--
   3 files changed, 20 insertions(+), 10 deletions(-)

Modified: trunk/boost/circular_buffer/base.hpp
==============================================================================
--- trunk/boost/circular_buffer/base.hpp Sun Jul 7 08:13:00 2013 (r84970)
+++ trunk/boost/circular_buffer/base.hpp 2013-07-07 08:59:57 EDT (Sun, 07 Jul 2013) (r84971)
@@ -27,9 +27,7 @@
 #include <algorithm>
 #include <utility>
 #include <deque>
-#if !defined(BOOST_NO_EXCEPTIONS)
- #include <stdexcept>
-#endif
+#include <stdexcept>
 #if BOOST_CB_ENABLE_DEBUG
     #include <cstring>
 #endif
@@ -170,7 +168,7 @@
     typedef typename call_traits<value_type>::param_type param_value_type;
 
     // A type representing the "best" way to return the value_type from a const method.
- typedef typename call_traits<value_type>::param_type return_value_type;
+ //typedef typename call_traits<value_type>::param_type return_value_type;
 
 private:
 // Member variables
@@ -397,7 +395,7 @@
              Constant (in the size of the <code>circular_buffer</code>).
         \sa <code>\link at(size_type)const at() const \endlink</code>
     */
- return_value_type operator [] (size_type index) const {
+ const_reference operator [] (size_type index) const {
         BOOST_CB_ASSERT(index < size()); // check for invalid index
         return *add(m_first, index);
     }
@@ -435,7 +433,7 @@
              Constant (in the size of the <code>circular_buffer</code>).
         \sa <code>\link operator[](size_type)const operator[] const \endlink</code>
     */
- return_value_type at(size_type index) const {
+ const_reference at(size_type index) const {
         check_position(index);
         return (*this)[index];
     }
@@ -489,7 +487,7 @@
              Constant (in the size of the <code>circular_buffer</code>).
         \sa <code>back() const</code>
     */
- return_value_type front() const {
+ const_reference front() const {
         BOOST_CB_ASSERT(!empty()); // check for empty buffer (front element not available)
         return *m_first;
     }
@@ -507,7 +505,7 @@
              Constant (in the size of the <code>circular_buffer</code>).
         \sa <code>front() const</code>
     */
- return_value_type back() const {
+ const_reference back() const {
         BOOST_CB_ASSERT(!empty()); // check for empty buffer (back element not available)
         return *((m_last == m_buff ? m_end : m_last) - 1);
     }

Modified: trunk/boost/circular_buffer/details.hpp
==============================================================================
--- trunk/boost/circular_buffer/details.hpp Sun Jul 7 08:13:00 2013 (r84970)
+++ trunk/boost/circular_buffer/details.hpp 2013-07-07 08:59:57 EDT (Sun, 07 Jul 2013) (r84971)
@@ -18,6 +18,14 @@
 #include <boost/detail/no_exceptions_support.hpp>
 #include <iterator>
 
+// Silence MS /W4 warnings like C4913:
+// "user defined binary operator ',' exists but no overload could convert all operands, default built-in binary operator ',' used"
+// This might happen when previously including some boost headers that overload the coma operator.
+#if defined(_MSC_VER)
+# pragma warning(push)
+# pragma warning(disable:4913)
+#endif
+
 namespace boost {
 
 namespace cb_details {
@@ -468,4 +476,8 @@
 
 } // namespace boost
 
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif
+
 #endif // #if !defined(BOOST_CIRCULAR_BUFFER_DETAILS_HPP)

Modified: trunk/boost/circular_buffer/space_optimized.hpp
==============================================================================
--- trunk/boost/circular_buffer/space_optimized.hpp Sun Jul 7 08:13:00 2013 (r84970)
+++ trunk/boost/circular_buffer/space_optimized.hpp 2013-07-07 08:59:57 EDT (Sun, 07 Jul 2013) (r84971)
@@ -49,7 +49,7 @@
     typedef typename circular_buffer<T, Alloc>::array_range array_range;
     typedef typename circular_buffer<T, Alloc>::const_array_range const_array_range;
     typedef typename circular_buffer<T, Alloc>::param_value_type param_value_type;
- typedef typename circular_buffer<T, Alloc>::return_value_type return_value_type;
+ //typedef typename circular_buffer<T, Alloc>::return_value_type return_value_type;
 
 /* <pre> is not passed through to html or pdf. So <br> is used in code section below. Ugly :-(
 Ideally want a link to capacity_control, but this would require include details
@@ -119,7 +119,7 @@
 
 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
     reference operator [] (size_type n) { return circular_buffer<T, Alloc>::operator[](n); }
- return_value_type operator [] (size_type n) const { return circular_buffer<T, Alloc>::operator[](n); }
+ const_reference operator [] (size_type n) const { return circular_buffer<T, Alloc>::operator[](n); }
 #else
     using circular_buffer<T, Alloc>::operator[];
 #endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk