[Issue 18790] can't put a const(char)[] into a char[]

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 22 01:14:08 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18790

--- Comment #5 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Jonathan M Davis from comment #1)
> Because char[] isn't an output range at all. isOutputRange!(char[], char) is
> false.

Something to consider: isOutputRange!(char[], char) is false because
put(char[], char) doesn't compile.

So it's not a good explanation as to why put doesn't work. We can make put
work, and then isOutputRange will be true. Fun fact: put has NO template
constraints. Because it IS the source of the template constraints.

This is something so arbitrary, and I'm working on the code now to get it to
work, there are some really self-defeating reasons why this isn't working. This
should be a no brainer. The reasons for char[] not being an input range of char
don't translate to output ranges.

--


More information about the Digitalmars-d-bugs mailing list