About removing the new keyword

bearophile bearophileHUGS at lycos.com
Sun Aug 29 10:43:41 PDT 2010


Daniel Gibson:
> Really? This is the first time I've heard about this.
> Why should it be removed anyway?

It was discussed a lot, and some people were about OK with the idea. The current new syntax is not nice looking, and maybe not necessary. The idea is to remove all not necessary things from D2 (if their absence doesn't uglify the code too much and doesn't reduce flexibility significantly).

A problem is that to new you need to give three things:
- optional placement, where to put the data
- what type to allocate
- an optional list of arguments for the constructor
- and some people have asked for templated constructors, so this is the best chance to introduce this.

Bye,
bearophile


More information about the Digitalmars-d mailing list