|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63592 - in trunk: boost/asio libs/asio/doc libs/asio/test
From: chris_at_[hidden]
Date: 2010-07-04 09:11:15
Author: chris_kohlhoff
Date: 2010-07-04 09:11:14 EDT (Sun, 04 Jul 2010)
New Revision: 63592
URL: http://svn.boost.org/trac/boost/changeset/63592
Log:
Add missing operator+ overload. Refs #4382.
Text files modified:
trunk/boost/asio/buffers_iterator.hpp | 9 ++++++++
trunk/libs/asio/doc/reference.qbk | 42 +++++++++++++++++++++++++++++++++++++++
trunk/libs/asio/test/buffers_iterator.cpp | 39 +++++++++++++++++++++++++++++++++++++
3 files changed, 89 insertions(+), 1 deletions(-)
Modified: trunk/boost/asio/buffers_iterator.hpp
==============================================================================
--- trunk/boost/asio/buffers_iterator.hpp (original)
+++ trunk/boost/asio/buffers_iterator.hpp 2010-07-04 09:11:14 EDT (Sun, 04 Jul 2010)
@@ -208,6 +208,15 @@
return tmp;
}
+ /// Addition operator.
+ friend buffers_iterator operator+(std::ptrdiff_t difference,
+ const buffers_iterator& iter)
+ {
+ buffers_iterator tmp(iter);
+ tmp.advance(difference);
+ return tmp;
+ }
+
/// Subtraction operator.
friend buffers_iterator operator-(const buffers_iterator& iter,
std::ptrdiff_t difference)
Modified: trunk/libs/asio/doc/reference.qbk
==============================================================================
--- trunk/libs/asio/doc/reference.qbk (original)
+++ trunk/libs/asio/doc/reference.qbk 2010-07-04 09:11:14 EDT (Sun, 04 Jul 2010)
@@ -34151,13 +34151,29 @@
[endsect]
-
[section:operator_plus_ buffers_iterator::operator+]
[indexterm2 operator+..buffers_iterator]
Addition operator.
+ friend buffers_iterator ``[link boost_asio.reference.buffers_iterator.operator_plus_.overload1 operator+]``(
+ const buffers_iterator & iter,
+ std::ptrdiff_t difference);
+ `` [''''»''' [link boost_asio.reference.buffers_iterator.operator_plus_.overload1 more...]]``
+
+ friend buffers_iterator ``[link boost_asio.reference.buffers_iterator.operator_plus_.overload2 operator+]``(
+ std::ptrdiff_t difference,
+ const buffers_iterator & iter);
+ `` [''''»''' [link boost_asio.reference.buffers_iterator.operator_plus_.overload2 more...]]``
+
+
+[section:overload1 buffers_iterator::operator+ (1 of 2 overloads)]
+
+
+Addition operator.
+
+
friend buffers_iterator operator+(
const buffers_iterator & iter,
std::ptrdiff_t difference);
@@ -34173,6 +34189,30 @@
[endsect]
+
+[section:overload2 buffers_iterator::operator+ (2 of 2 overloads)]
+
+
+Addition operator.
+
+
+ friend buffers_iterator operator+(
+ std::ptrdiff_t difference,
+ const buffers_iterator & iter);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/buffers_iterator.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[endsect]
+
[section:operator_plus__plus_ buffers_iterator::operator++]
[indexterm2 operator++..buffers_iterator]
Modified: trunk/libs/asio/test/buffers_iterator.cpp
==============================================================================
--- trunk/libs/asio/test/buffers_iterator.cpp (original)
+++ trunk/libs/asio/test/buffers_iterator.cpp 2010-07-04 09:11:14 EDT (Sun, 04 Jul 2010)
@@ -213,6 +213,45 @@
bi11 += 1;
bi12 += 1;
+ bi1 = bi1 - 1;
+ bi2 = bi2 - 1;
+ bi3 = bi3 - 1;
+ bi4 = bi4 - 1;
+ bi5 = bi5 - 1;
+ bi6 = bi6 - 1;
+ bi7 = bi7 - 1;
+ bi8 = bi8 - 1;
+ bi9 = bi9 - 1;
+ bi10 = bi10 - 1;
+ bi11 = bi11 - 1;
+ bi12 = bi12 - 1;
+
+ bi1 = bi1 + 1;
+ bi2 = bi2 + 1;
+ bi3 = bi3 + 1;
+ bi4 = bi4 + 1;
+ bi5 = bi5 + 1;
+ bi6 = bi6 + 1;
+ bi7 = bi7 + 1;
+ bi8 = bi8 + 1;
+ bi9 = bi9 + 1;
+ bi10 = bi10 + 1;
+ bi11 = bi11 + 1;
+ bi12 = bi12 + 1;
+
+ bi1 = (-1) + bi1;
+ bi2 = (-1) + bi2;
+ bi3 = (-1) + bi3;
+ bi4 = (-1) + bi4;
+ bi5 = (-1) + bi5;
+ bi6 = (-1) + bi6;
+ bi7 = (-1) + bi7;
+ bi8 = (-1) + bi8;
+ bi9 = (-1) + bi9;
+ bi10 = (-1) + bi10;
+ bi11 = (-1) + bi11;
+ bi12 = (-1) + bi12;
+
(void)static_cast<std::ptrdiff_t>(bi13 - bi1);
(void)static_cast<std::ptrdiff_t>(bi14 - bi2);
(void)static_cast<std::ptrdiff_t>(bi15 - bi3);
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