eliminate new operator paraphernalia

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Feb 14 13:30:49 PST 2010


Nick Sabalausky wrote:
> "Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message 
> news:hl9end$1u8k$1 at digitalmars.com...
>> Second, the whole new anonymous class thing is for Java's sake. Do you 
>> think we need to keep all that?
>>
> 
> It doesn't bother me having it, but I can't say I can imagine ever having a 
> use for it outside a fully dynamic scripting language (or maybe Java, but 
> well, Java tools and features tend to be useful primarily as workarounds for 
> Java being it's usual Javay self).
> 
>> new T[length]
>> new T(initializerlist)
> 
> Isn't that exactly what we already have?
> 
>> new(addr) T[length]
>> new(addr) T(initializerlist)
>>
> 
> I'm not sure I see the point of that. Can't you just call the ctor directly? 

You can't. I mean there is a __ctor thing but user code shouldn't depend 
on that.

Andrei



More information about the Digitalmars-d mailing list