[Issue 11319] std.range.zip is not yet nothrow
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Apr 25 03:45:53 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=11319
--- Comment #2 from bearophile_hugs at eml.cc ---
(In reply to Andrej Mitrovic from comment #1)
> This is a bit impossible to fix.
This is a rather important issue, because zip is used often in functional-style
code. So lot of that code can't be nothrow because of zip.
Perhaps this issue is a duplicated, because elsewhere I've seen more discussion
about this problem.
I think this problem can be fixed in one cast that is important and common. I
remember the zip that needs to throw is just the one the requires equal length
ranges as input. So the most common zip could be nothrow. To do this you have
to specify what kind of zip behavour you want with a compile-time argument, to
allow the static specialization. This means changing zip API a little. Perhaps
such change can be done in a gentle way, allowing both APIs for some time.
--
More information about the Digitalmars-d-bugs
mailing list