https://issues.dlang.org/show_bug.cgi?id=13608
Issue ID: 13608
Summary: std.range range interfaces hide @safe-ness
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: [email protected]
Reporter: [email protected]
The range interfaces (InputRange, OutputRange, etc) and their helper creation
functions hide the @safe-ness. This makes it problematic to use them in what
would otherwise be @safe code. For instance, in std/algorithm.d:
unittest
{
// joiner() should work for non-forward ranges too.
InputRange!string r = inputRangeObject(["abc", "def"]);
assert (equal(joiner(r, "xyz"), "abcxyzdef"));
}
yields:
std/algorithm.d(3927): Error: safe function 'std.algorithm.__unittestL3923_114'
cannot call system function 'std.algorithm.joiner!(InputRange!string,
string).joiner'
std/algorithm.d(3927): Error: safe function 'std.algorithm.__unittestL3923_114'
cannot call system function 'std.algorithm.equal!().equal!(Result,
string).equal'
--