This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to control order of C++ singleton instantiation?

I have a C++ project in which several singleton classes are declared.  I'd like to control the order in which several critical objects (such as the system clock) are instantiated (other classes are dependent on these core objects).  Is there a simple way to manage this or do I need to do it via the linker command file and declaring psects via #pragma?

Also, what is the expected execution order for singletons, this is; is execution a linear progression through each object until they're all instantiated at which point we reach the "main" entry point?

Thank you,
Mike