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
Post a Comment