[Issue 3383] newVoid

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3383

Andrei Alexandrescu  changed:

   What|Removed |Added

Version|2.033   |D2

--


[Issue 3383] newVoid

2011-08-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3383


David Simcha  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #4 from David Simcha  2011-08-12 20:43:48 PDT ---
This evolved into std.array.uninitializedArray.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3383] newVoid

2011-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3383



--- Comment #3 from bearophile_h...@eml.cc 2011-06-06 03:26:11 PDT ---
One case worth considering:

auto mat = new int[5][5];
foreach (row; mat)
row[] = 10;

The way used to initialize a matrix to void is useful to initialize all of it
to a defined value too.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3383] newVoid

2011-06-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3383


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #2 from bearophile_h...@eml.cc 2011-06-05 12:29:45 PDT ---
Nicer and cleaner:

// doesn't initialize foo1
auto foo1 = new uint[5] = void;

// initializes the dynamic array to 5, avoiding a double initialization
auto foo2 = new uint[5] = 5;

That syntax is inspired by static array syntax:
uint[5] a1 = void;
uint[5] a2 = 5;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3383] newVoid

2011-06-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3383


Andrei Alexandrescu  changed:

   What|Removed |Added

 AssignedTo|and...@metalanguage.com |dsim...@yahoo.com


--- Comment #1 from Andrei Alexandrescu  2011-06-05 
08:18:18 PDT ---
Reassigning this to David. David, this is a sensible primitive. You may want to
make it into a pull request, probably in std.array or even in druntime. A few
notes:

1. newVoid is not very indicative, I'd suggest something long and
obvious-looking (as this can be an unsafe function), e.g.
makeUninitializedArray!int(100).

2. Since 0 seems to be an actually used constant of GC.BlkAttr, you may as well
give it a name, e.g. NONE.

Thanks!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3383] newVoid

2009-10-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3383


Andrei Alexandrescu  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||and...@metalanguage.com
 AssignedTo|nob...@puremagic.com|and...@metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---