Rename std.string.toStringz?

Daniel Gibson metalcaedes at gmail.com
Thu Jun 16 12:08:54 PDT 2011


Am 16.06.2011 20:30, schrieb Kagamin:
> Daniel Gibson Wrote:
> 
>>>> So c_long converts a long to a c-long?
>>>> (Is this a D function/type? I couldn't find it on the homepage)
>>>
>>> It's not a conversion function, but an alias. It's declared, along with
>>> c_ulong, in core.stdc.config.
>>
>> So it has nothing to do with toStringz and similar names would be confusing.
> 
> May be
> 
> struct c_str{}
> to!c_str();

No.
The whole point of toStringz() is that it returns a string that can be
fed to normal C functions that work on strings.
And C functions expect a "string" to be a char* (or wchar*) pointing to
a block of memory containing the string and terminated by '\0'.
The functionality of toStringz() should not change.
This is just about the name.

Cheers,
- Daniel


More information about the Digitalmars-d mailing list