
9 Mar
2005
9 Mar
'05
10:10 p.m.
"Andreas Huber" wrote:
2. At runtime. Each TU could have one static variable of a type with a constructor. Inside the ctor you register your part of the FSM with the FSM object. This sounds like it could work. Problem is that the standard does not give many guarantees when exactly these static objects are constructed. You can *hope* that they are constructed before the FSM object and on some platforms they actually are constructed at program startup but there's no guarantee for that. Just note: Singleton library (the one written by Jason Hise) allows guaranteed construction order for objects in multiple TUs.
/Pavel