forked from boostorg/iterator
Make sure that X(r++) works for writable iterators.
[SVN r24420]
This commit is contained in:
@ -203,6 +203,13 @@ namespace boost
|
|||||||
*this->stored_iterator = x;
|
*this->stored_iterator = x;
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Provides X(r++)
|
||||||
|
operator Iterator const&() const
|
||||||
|
{
|
||||||
|
return stored_iterator;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable value_type stored_value;
|
mutable value_type stored_value;
|
||||||
Iterator stored_iterator;
|
Iterator stored_iterator;
|
||||||
|
@ -64,6 +64,6 @@ int main()
|
|||||||
state = 3;
|
state = 3;
|
||||||
boost::readable_iterator_test(counter_iterator<proxy>(&state), 3);
|
boost::readable_iterator_test(counter_iterator<proxy>(&state), 3);
|
||||||
boost::writable_iterator_test(counter_iterator<proxy>(&state), 9, 7);
|
boost::writable_iterator_test(counter_iterator<proxy>(&state), 9, 7);
|
||||||
BOOST_ASSERT(state == 7);
|
BOOST_ASSERT(state == 8);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user