D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4801 - Incorrect stride example
Summary: Incorrect stride example
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-03 08:41 UTC by Andrej Mitrovic
Modified: 2010-09-03 16:29 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2010-09-03 08:41:16 UTC
From: http://www.digitalmars.com/d/2.0/phobos/std_range.html#stride

int[] a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ];
assert(equal(stride(a, 3) == [ 1, 4, 7, 10 ][]));

The assert should be:
assert(equal(stride(a, 3), [ 1, 4, 7, 10 ]));