[Issue 10718] std.algorithm.copy should keep the type of the characters it copies

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 26 07:43:00 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10718



--- Comment #2 from bearophile_hugs at eml.cc 2013-07-26 07:42:59 PDT ---
(In reply to comment #1)

> I strongly disagree. std.algorithm operates on ranges. a string is a range of
> dchars.

In code like this the map yield chars, yet copy converts them to dchar, is this
good?

import std.range, std.algorithm;
void main() {
    char[5] arr;
    auto r = 5.iota.map!(i => cast(char)(i + 'a'));
    static assert(is(typeof(r.front) == char)); // OK
    r.copy(arr[]); // error
}


Thank you for your answers. Do you suggest to close down this issue?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list