NotNull pointers

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Aug 30 09:35:08 PDT 2011


On 8/29/11 7:49 PM, bearophile wrote:
[snip]

> void main() {
>      auto a = new nFoo[5];
>      bar(a[0]);
> }

Ah, that reminds me. The introduction of @disable requires the 
introduction of array-with-constructor syntax that has long been 
proposed to both C++ and D:

new Type[n](argument1, argument2, ..., argumentn)

creates an array of Type of size n. Each element is constructed with 
argument list (argument1, argument2, ..., argumentn).


Andrei


More information about the Digitalmars-d mailing list