[Boost-bugs] [Boost C++ Libraries] #6944: Some Range concepts use the incorrect Iterator concept

Subject: [Boost-bugs] [Boost C++ Libraries] #6944: Some Range concepts use the incorrect Iterator concept
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-05-25 09:42:12


#6944: Some Range concepts use the incorrect Iterator concept
----------------------------------------------------+-----------------------
 Reporter: Andrew Morris <andy@…> | Owner: neilgroves
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: range
  Version: Boost 1.49.0 | Severity: Problem
 Keywords: |
----------------------------------------------------+-----------------------
 Due to an omitted namespace specification, the BidirectionalRangeConcept
 and RandomAccessRangeConcept inside <boost\range\concepts.hpp> use the STL
 iterator concept checking classes in <boost\concept_check.hpp> instead of
 the appropriate concepts inside the same file.

 This issue was actually noticed in ticket #4355, but a different fix was
 applied.

 The reason that the Range concepts should not use the STL iterator
 concepts is because the Range concepts only require the relevant traversal
 concept.
 ([http://www.boost.org/doc/libs/1_49_0/libs/range/doc/html/range/concepts/overview.html
 Source])

 This example fails on Cygwin g++4.7 and VC2010
 {{{
 #include <boost/concept_check.hpp>
 #include <boost/iterator/iterator_adaptor.hpp>
 #include <boost/range/concepts.hpp>
 #include <boost/range/iterator_range.hpp>
 #include <vector>

 typedef std::vector<int>::iterator iter_base;
 struct iter : boost::iterator_adaptor<iter, iter_base, int,
 boost::use_default, int> {}; // will be deduced as random-access traversal
 but input category
 typedef boost::iterator_range<iter> iter_range;

 BOOST_CONCEPT_ASSERT(( boost::RandomAccessRangeConcept<iter_range> ));
 }}}

 I've attached a patch for this issue.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6944>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC