D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7775 - std.range.chunks on const array of strings too
Summary: std.range.chunks on const array of strings too
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 enhancement
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2012-03-25 13:02 UTC by bearophile_hugs
Modified: 2015-01-27 02:57 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 bearophile_hugs 2012-03-25 13:02:09 UTC
import std.range: chunks;
import std.array: join;
void main() {
    const data = ["a1", "b2", "c3", "d4", "e5"];
    foreach (c; chunks(data, 2))
        string r = join(c);
}


DMD 2.059head gives:

test.d(6): Error: template std.array.join(RoR,R) if (isInputRange!(RoR) && isInputRange!(ElementType!(RoR)) && isForwardRange!(R) && is(Unqual!(ElementType!(ElementType!(RoR))) == Unqual!(ElementType!(R)))) does not match any function template declaration
test.d(6): Error: template std.array.join(RoR,R) if (isInputRange!(RoR) && isInputRange!(ElementType!(RoR)) && isForwardRange!(R) && is(Unqual!(ElementType!(ElementType!(RoR))) == Unqual!(ElementType!(R)))) cannot deduce template function from argument types !()(const(immutable(char)[])[])
Comment 1 AndyC 2015-01-27 02:57:09 UTC
compiled and ran fine on x64 linux and x64 windows using dmd 2.066.1

Assuming bug must have been fixed but cannot find commit.