www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - void as Initializer?

reply Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
What does this declaration mean?
     char[uint.sizeof * 3] buffer = void;
(taken from std.string, line 2049, in dmd 0.128)
Jul 14 2005
next sibling parent David Medlock <noone nowhere.com> writes:
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.
Jul 14 2005
prev sibling parent reply Stefan <Stefan_member pathlink.com> writes:
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
Jul 14 2005
parent Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
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

Jul 17 2005