Subject: [Boost-bugs] [Boost C++ Libraries] #8488: Code/doc mismatch in iterator_facade distance_to
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-23 18:39:57
#8488: Code/doc mismatch in iterator_facade distance_to
-------------------------------+--------------------------------------------
Reporter: gredner@⦠| Owner: jeffrey.hellrung
Type: Bugs | Status: new
Milestone: To Be Determined | Component: iterator
Version: Boost 1.52.0 | Severity: Problem
Keywords: |
-------------------------------+--------------------------------------------
When creating a random access facade, one must implement the distance_to
member function in order for std::distance to work. However, it looks
like the arguments passed to this method are reversed from what the
documentation states.
Specifically, the docs [1] say (paraphrased): a.distance_to(b) is
equivalent to distance(a, b).
However, when I call std::distance(a, b), I find that b.distance_to(a) is
invoked in the facade - the mirror image of what the docs say!
A test case demonstrating the problem is attached.
[1]
http://www.boost.org/doc/libs/1_53_0/libs/iterator/doc/iterator_facade.html
#iterator-facade-requirements
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8488> 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:12 UTC