[Boost-bugs] [Boost C++ Libraries] #11297: adaptors: Documentation for sliced reports the wrong precondition

Subject: [Boost-bugs] [Boost C++ Libraries] #11297: adaptors: Documentation for sliced reports the wrong precondition
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-13 10:32:50


#11297: adaptors: Documentation for sliced reports the wrong precondition
------------------------------------------------+------------------------
 Reporter: Frederik Aalund <frederikaalund@…> | Owner: neilgroves
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: range
  Version: Boost 1.58.0 | Severity: Problem
 Keywords: |
------------------------------------------------+------------------------
 Currently, the precondition for the sliced adaptor is

 Precondition: 0 <= n && n <= m && m < distance(rng).

 It should instead be

 Precondition: 0 <= n && n <= m && m <= distance(rng).

 Notice the <= instead of <.

 The page in question is
 [http://www.boost.org/doc/libs/1_58_0/libs/range/doc/html/range/reference/adaptors/reference/sliced.html].

 Nitpicky: Maybe a better upper bound would be m <= size(rng) since
 boost::size returns a range_size<rng>::type which is the type of n and m
 (the parameters given to adaptors::sliced). Contrast this to
 boost::distance which returns a range_difference<rng>::type.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11297>
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:18 UTC