Opened 7 years ago
#11297 new Bugs
adaptors: Documentation for sliced reports the wrong precondition
Reported by: | Owned by: | Neil Groves | |
---|---|---|---|
Milestone: | To Be Determined | Component: | range |
Version: | Boost 1.58.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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.