Rename std.string.toStringz?
Byakkun
byakkun at myopera.com
Sat Jun 18 15:55:02 PDT 2011
On Sun, 19 Jun 2011 01:42:16 +0300, Jonathan M Davis <jmdavisProg at gmx.com>
wrote:
> On 2011-06-18 06:35, Andrei Alexandrescu wrote:
>> On 6/18/11 4:59 AM, Jonathan M Davis wrote:
>> > I'll look at renaming toUTF16z to toWStringz to match toStringz (as
>> was
>> > suggested by a couple of people in this thread)
>>
>> That should be a template toUTFz that takes either char*, wchar*, or
>> dchar*.
>
> A good point. Are you arguing that toStringz should be replaced by such a
> construct? Or that it should simply exist in addition to toStringz?
>
> Also, we _could_ make it so that such a template would take the
> mutabality of
> the pointer as well (e.g. toUTF!(char*)(str), toUTF!(const(char)*),
> etc.),
> which would allow it to be used in cases where you actually want a
> mutable
> string (which toStringz doesn't do).
>
> - Jonathan M Davis
I think Jonathan saw this but just in case Andrei and others haven't
consider the following stackoverflow question
http://stackoverflow.com/questions/6393774/obtaining-a-plain-char-from-a-string-in-d
in regard to his proposal.
--
Using Opera's revolutionary email client: http://www.opera.com/mail/
More information about the Digitalmars-d
mailing list