Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#7731 closed Bugs (fixed)

irange doesn't end iteration properly when step_size is 3 or more

Reported by: mazay0@… Owned by: Neil Groves
Milestone: To Be Determined Component: range
Version: Boost 1.52.0 Severity: Showstopper
Keywords: Cc:

Description

The code

std::cout << boost::irange(0, 10, 3) << std::endl;

prints "036" instead of "0369".

Similar (but another) bug: https://svn.boost.org/trac/boost/ticket/5544

Attachments (1)

irange.hpp.patch (609 bytes ) - added by mazay0@… 10 years ago.
patch for irange

Download all attachments as: .zip

Change History (5)

by mazay0@…, 10 years ago

Attachment: irange.hpp.patch added

patch for irange

comment:1 by Nathan Ridge, 9 years ago

(In [84701]) [range] Fix off-by-one error in implementation of irange() (refs #7731).

comment:2 by Nathan Ridge, 9 years ago

Thanks for the report and patch! Fixed in trunk.

comment:3 by Nathan Ridge, 9 years ago

Resolution: fixed
Status: newclosed

(In [84823]) [range] Merge Boost.Range bug fixes to release branch (fixes #6944; fixes #7407; fixes #7408; fixes #7731; fixes #7827; fixes #8338; fixes #8453).

comment:4 by Nathan Ridge, 9 years ago

Fixed for 1.54.

Note: See TracTickets for help on using tickets.