Bug 11196 – `std.range.zip` fails to compile if range elements aren't default contructable

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-08T06:07:00Z
Last change time
2013-10-19T02:39:54Z
Keywords
rejects-valid
Assigned to
verylonglogin.reg
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2013-10-08T06:07:04Z
Insted it should throw if range with non default contructable elements is exhausted: --- import std.exception, std.range; void main() { static struct S { @disable this(); } static assert(__traits(compiles, zip((S[5]).init[]))); // assert fails // This is assumed to compile and pass: assertThrown(zip(StoppingPolicy.longest, cast(S[]) null, new int[1]).front); } ---
Comment #1 by verylonglogin.reg — 2013-10-08T06:09:22Z
Comment #2 by github-bugzilla — 2013-10-08T08:01:14Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/6788a62506f7638c7f7a19637bad9d536b378cb6 Fix Issue 11196 - `std.range.zip` fails to compile if range elements aren't default contructable Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=11196 https://github.com/D-Programming-Language/phobos/commit/af32ce421480369733c2b62c17a00eb3689655fe Merge pull request #1619 from denis-sh/fix-Issue-11196 Fix Issue 11196 - `std.range.zip` fails to compile if range elements aren't default contructable