struct inheritance need?

Sergey Gromov snake.scaly at gmail.com
Fri Dec 19 05:39:47 PST 2008


Fri, 19 Dec 2008 04:07:40 -0500, Kagamin wrote:

> Derek Parnell Wrote:
> 
>> A static constructor (also known as the Module constructor) executes at
>> program run-time and not at program compile-time.
> 
> So do C++ static object constructors. Though C++ has syntax sugar,
> which helps writing declaration and initialization at the same place.

C++ static object constructors execute at run time except for trivial
cases.  Essentially C++ provides a sugar for

static Foo var;
static this() { var = new Foo(); }

I wonder if D could do this as well.


More information about the Digitalmars-d-learn mailing list