Program size, linking matter, and static this()

Sean Kelly sean at invisibleduck.org
Fri Dec 16 15:32:30 PST 2011


On Dec 16, 2011, at 3:24 PM, Walter Bright wrote:

> On 12/16/2011 3:18 PM, maarten van damme wrote:
>> how did other languages solve this issue? I can't imagine D beeing the only
>> language with static constructors, do they have that problem too?
> 
> In C++, the order that static constructors run is implementation defined. No guarantees at all. The programmer has no reasonable way to control the order in which they are done.
> 
> (Of course, C++ doesn't even have modules, so the notion of a module constructor is tenuous at best.)

This aspect of C++ drives me absolutely crazy.  Though I imagine it bothers a lot of people given all the coverage static initialization has gotten in C++ literature.


More information about the Digitalmars-d mailing list