View mode: basic / threaded / horizontal-split · Log in · Help
July 14, 2005
void as Initializer?
What does this declaration mean?
    char[uint.sizeof * 3] buffer = void;
(taken from std.string, line 2049, in dmd 0.128)
July 14, 2005
Re: void as Initializer?
Russ Lewis wrote:

> What does this declaration mean?
>     char[uint.sizeof * 3] buffer = void;
> (taken from std.string, line 2049, in dmd 0.128)

I believe it means do not initialize the buffer.
Its an optimization.
July 14, 2005
Re: void as Initializer?
In article <db5v7u$2thc$1@digitaldaemon.com>, Russ Lewis says...
>
>What does this declaration mean?
>     char[uint.sizeof * 3] buffer = void;
>(taken from std.string, line 2049, in dmd 0.128)

It's documented here:

http://www.digitalmars.com/d/memory.html#uninitializedarrays

Best regards,
Stefan
July 18, 2005
Re: void as Initializer?
Stefan wrote:
> In article <db5v7u$2thc$1@digitaldaemon.com>, Russ Lewis says...
> 
>>What does this declaration mean?
>>    char[uint.sizeof * 3] buffer = void;
>>(taken from std.string, line 2049, in dmd 0.128)
> 
> 
> It's documented here:
> 
> http://www.digitalmars.com/d/memory.html#uninitializedarrays
> 
> Best regards,
> Stefan
> 
> 
Cool, thanks for the pointer to the official answer!
Top | Discussion index | About this forum | D home