Anonymous classes should pass through super ctors

Denis Koroskin 2korden at gmail.com
Sat Aug 23 07:53:28 PDT 2008


On Mon, 18 Aug 2008 23:13:42 +0400, Sean Kelly <sean at invisibleduck.org>  
wrote:

> Bruno Medeiros wrote:
>> Jarrett Billingsley wrote:
>>> "Frank Benoit" <keinfarbton at googlemail.com> wrote in message  
>>> news:g83v3k$n2u$1 at digitalmars.com...
>>>> Anonymous classes should pass through super ctors, if no ctor is  
>>>> given.
>>>>
>>>> class C {
>>>>    this( int i ){ .... }
>>>>    abstract void run();
>>>>    // ...
>>>> }
>>>>
>>>> auto c = new class(3) C {
>>>>    this( int a ){ super(a); } //<-- this line should not be necessary.
>>>>    void run(){}
>>>> };
>>>
>>> All classes should pass through super ctors.  :|
>
> Okay... I decided to dig up the proposal after all:
>
> http://www.digitalmars.com/d/archives/digitalmars/D/Inheriting_constructors_54088.html
>
>
> Sean

FWIW, C++0x has this feature and we still don't :p

http://en.wikipedia.org/wiki/C++0x#Object_construction_improvement



More information about the Digitalmars-d mailing list