string is rarely useful as a function argument

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Dec 31 13:33:23 PST 2011


On 12/31/11 2:44 PM, Michel Fortin wrote:
> But will s.raw.popFront() also pop a single unit from s? "raw" would
> need to be defined as a reinterpret cast of the reference to the char[]
> to do what I want, something like this:
>
> ref ubyte[] raw(ref char[] s) { return *cast(ubyte[]*)&s; }
>
> The current std.string.representation doesn't do that at all.

You just found a bug!

Andrei


More information about the Digitalmars-d mailing list