[Issue 12086] New: std.algorithm.remove + range of indices produces wrong results
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 5 12:52:37 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12086
Summary: std.algorithm.remove + range of indices produces wrong
results
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: justin at economicmodeling.com
--- Comment #0 from Justin Whear <justin at economicmodeling.com> 2014-02-05 12:52:34 PST ---
While the documentation for std.algorithm.remove does not mention using a range
of indices, it quietly accepts such. Given that std.algorithm deals
extensively in ranges, there is an implicit expectation that a range of indices
should work--an expectation that is confirmed by the fact that such a usage of
remove both compiles and runs.
---------------------------------------
import std.stdio, std.algorithm;
void main(string[] args)
{
writeln( [0,1,2,3,4].remove(1, 3) );
// 0, 2, 4 -- correct
writeln( [0,1,2,3,4].remove([1, 3]) );
// 0, 3, 4 -- incorrect
}
---------------------------------------
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list