|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67430 - trunk/boost/range
From: neil_at_[hidden]
Date: 2010-12-23 06:56:41
Author: neilgroves
Date: 2010-12-23 06:56:27 EST (Thu, 23 Dec 2010)
New Revision: 67430
URL: http://svn.boost.org/trac/boost/changeset/67430
Log:
[boost][range] - Resolved Trac ticket 4355 - Concepts did not check that iterators must be dereferencable.
Text files modified:
trunk/boost/range/concepts.hpp | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
Modified: trunk/boost/range/concepts.hpp
==============================================================================
--- trunk/boost/range/concepts.hpp (original)
+++ trunk/boost/range/concepts.hpp 2010-12-23 06:56:27 EST (Thu, 23 Dec 2010)
@@ -98,8 +98,9 @@
// classes:
//
// The Range algorithms often do not require that the iterators are
- // Assignable, but the correct standard conformant iterators
- // do require the iterators to be a model of the Assignable concept.
+ // Assignable or default constructable, but the correct standard
+ // conformant iterators do require the iterators to be a model of the
+ // Assignable concept.
// Iterators that contains a functor that is not assignable therefore
// are not correct models of the standard iterator concepts,
// despite being adequate for most algorithms. An example of this
@@ -141,6 +142,23 @@
BOOST_DEDUCED_TYPENAME SinglePassIteratorConcept::traversal_category,
single_pass_traversal_tag
>));
+
+ BOOST_CONCEPT_USAGE(SinglePassIteratorConcept)
+ {
+ Iterator i2(++i);
+ boost::ignore_unused_variable_warning(i2);
+
+ Iterator i3(i++);
+ boost::ignore_unused_variable_warning(i3);
+
+ BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits<Iterator>::reference r1(*i);
+ boost::ignore_unused_variable_warning(r1);
+
+ BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits<Iterator>::reference r2(*i++);
+ boost::ignore_unused_variable_warning(r2);
+ }
+ private:
+ Iterator i;
#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