Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66137 - trunk/libs/unordered/test/helpers
From: dnljms_at_[hidden]
Date: 2010-10-21 16:34:42


Author: danieljames
Date: 2010-10-21 16:34:39 EDT (Thu, 21 Oct 2010)
New Revision: 66137
URL: http://svn.boost.org/trac/boost/changeset/66137

Log:
Missing copy_iterator methods.
Text files modified:
   trunk/libs/unordered/test/helpers/input_iterator.hpp | 39 +++++++++++++++++++++++++++++++++++----
   1 files changed, 35 insertions(+), 4 deletions(-)

Modified: trunk/libs/unordered/test/helpers/input_iterator.hpp
==============================================================================
--- trunk/libs/unordered/test/helpers/input_iterator.hpp (original)
+++ trunk/libs/unordered/test/helpers/input_iterator.hpp 2010-10-21 16:34:39 EDT (Thu, 21 Oct 2010)
@@ -95,17 +95,20 @@
         value_type* operator->() const {
             return &*base_;
         }
+ value_type operator[](difference_type d) {
+ return base_[d];
+ }
         copy_iterator_adaptor& operator++() {
             ++base_; return *this;
         }
         copy_iterator_adaptor operator++(int) {
             copy_iterator_adaptor tmp(*this); ++base_; return tmp;
         }
- bool operator==(copy_iterator_adaptor const& x) const {
- return base_ == x.base_;
+ copy_iterator_adaptor& operator--() {
+ --base_; return *this;
         }
- bool operator!=(copy_iterator_adaptor const& x) const {
- return base_ != x.base_;
+ copy_iterator_adaptor operator--(int) {
+ copy_iterator_adaptor tmp(*this); --base_; return tmp;
         }
         copy_iterator_adaptor operator+=(difference_type x) {
             base_ += x;
@@ -115,9 +118,37 @@
             base_ -= x;
             return *this;
         }
+ copy_iterator_adaptor operator+(difference_type n) {
+ return copy_iterator_adaptor(base_+n);
+ }
+ copy_iterator_adaptor operator-(difference_type n) {
+ return copy_iterator_adaptor(base_-n);
+ }
+ friend copy_iterator_adaptor operator+(
+ difference_type n, copy_iterator_adaptor x) {
+ return x+n;
+ }
         difference_type operator-(copy_iterator_adaptor const& other) {
             return base_-other.base_;
         }
+ bool operator==(copy_iterator_adaptor const& x) const {
+ return base_ == x.base_;
+ }
+ bool operator!=(copy_iterator_adaptor const& x) const {
+ return base_ != x.base_;
+ }
+ bool operator<(copy_iterator_adaptor const& x) const {
+ return base_ < x.base_;
+ }
+ bool operator>(copy_iterator_adaptor const& x) const {
+ return base_ > x.base_;
+ }
+ bool operator<=(copy_iterator_adaptor const& x) const {
+ return base_ <= x.base_;
+ }
+ bool operator>=(copy_iterator_adaptor const& x) const {
+ return base_ >= x.base_;
+ }
     private:
         Iterator base_;
     };


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