[Proposal] Add module for C-strings support in Phobos

"Nordlöw" per.nordlow at gmail.com
Sat Mar 22 06:32:11 PDT 2014


On Saturday, 22 March 2014 at 13:21:45 UTC, Adam D. Ruppe wrote:
> On Saturday, 22 March 2014 at 13:01:11 UTC, Nordlöw wrote:
>> gives same error
>
> That's because you made the alias local, UFCS only works with 
> global symbols right now (which is actually by design, though I 
> don't think it is a great design). So this works:
>
> // move these out to module scope
>     import std.string;
>     alias z = toStringz;
>
> unittest {
>     import std.stdio: wln = writeln;
>     wln(typeof("a".z).stringof); // now we're good/
> }

Ok. Great.

Still...I believe a warning hint should be outputted. This is not 
obvious.

/Per


More information about the Digitalmars-d mailing list