O. Shekriladze
O. Shekriladze

Reputation: 1536

Does static initialization fiasco occurs only in c++?

I just found out that there is static initialization fiasco problem in c++, I am just curious, is this only c++ problem? or maybe this problem is already fixed even in c++?

Upvotes: -3

Views: 92

Answers (1)

Alex Guteniev
Alex Guteniev

Reputation: 13634

In Delphi, each unit can have initialization and finalization section. (Unit is single source file).

Provided that there are no circular dependencies between units, initialization of dependency would come before than initialization of dependent module. Finalization order is reverse.

I think this is an example of that the problem could have been avoided.

Upvotes: 0

Related Questions