[Issue 12470] std.array.replace does not work with inout(char)[]
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Apr 23 12:58:13 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12470
--- Comment #5 from Andrej Mitrovic <andrej.mitrovich at gmail.com> ---
It seems the bottom-line problem is this:
-----
import std.array;
import std.range;
inout(char)[] sanitize(inout(char)[] input)
{
auto app = appender!(inout(char)[])();
// fails because of inout(char) as the element type
static assert(isOutputRange!(typeof(app), inout(char)));
}
-----
And it fails because of this strange nested declaration inside of the put
method:
@property ref E[] EArrayInit(); //@@@9186@@@: Can't use (E[]).init
std\range.d(656): Error: inout on return means inout must be on a parameter as
well for @property ref inout(char)[]()
I guess this was some kind of funky workaround, but it causes issues for 12470.
I'm not sure how to proceed yet.
--
More information about the Digitalmars-d-bugs
mailing list