The more interesting question

Steven Schveighoffer schveiguy at yahoo.com
Fri May 18 08:18:46 PDT 2012


On Fri, 18 May 2012 11:05:21 -0400, Christophe Travert  
<travert at phare.normalesup.org> wrote:

> "Steven Schveighoffer" , dans le message (digitalmars.D:167556), a
>> toStringz can allocate a new block in order to ensure 0 gets added.   
>> This
>> is ludicrous!
>>
>> You are trying to tell me that any time I want to call a C function  
>> with a
>> string literal, I have to first heap-allocate it, even though I *know*
>> it's safe.
>
> How about "mystring\0".ptr ?

AKA "mystring" :)

I'm sorry, I don't see the reason to require this.  All for the sake of  
making "" a null slice.  I find the net gain quite trivial.

-Steve


More information about the Digitalmars-d mailing list