oop - C++ Quiz - Singletons -


i'll posting article on my blog, i'd verify haven't missed first.

find example i've missed, , i'll cite on post.

the topic failed singleton implementations: in cases can accidentally multiple instances of singleton?

so far, i've come with:

  • race condition on first call instance()
  • incorporation multiple dlls or dll , executable
  • template definition of singleton - separate classes

any other ways i'm missing - perhaps inheritance?

if use static instance field initialize in cpp file, can multiple instances (and worse behavior) if initialization of static/global tries instance of singleton. because order of static initialization across compilation units undefined.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -