<p>I'll soon be posting an article on <a href="http://theschmitzer.blogspot.com" rel="nofollow noreferrer">my blog</a>, but I'd like to verify I haven't missed anything first.</p>

<p>Find an example I've missed, and I'll cite you on my post.</p>

<p>The topic is failed Singleton implementations: In what cases can you <em>accidentally</em> get multiple instances of a singleton?</p>

<p>So far, I've come up with:</p>

<ul>
<li>Race Condition on first call to <code>instance()</code></li>
<li>Incorporation into multiple DLLs or DLL and executable  </li>
<li>Template definition of a singleton - actually separate classes</li>
</ul>

<p>Any other ways I'm missing - perhaps with inheritance?</p>

[{'answer_id': 60347, 'author': 'David Joyner', 'author_id': 1146, 'author_profile': 'https://Stackoverflow.com/users/1146', 'pm_score': 1, 'selected': False, 'text': '<p>Inheritance shouldn\'t be an issue as long as the ctor is private.</p>\n\n<p>However, if you don\'t disallow the copy constructor, users may [un]intentionally copy the singleton instance.  Privately inheriting from <a href="http://www.boost.org/doc/libs/1_36_0/libs/utility/utility.htm" rel="nofollow noreferrer">boost::noncopyable</a> is the easiest way to prevent this.</p>\n'}, {'answer_id': 60355, 'author': 'On Freund', 'author_id': 2150, 'author_profile': 'https://Stackoverflow.com/users/2150', 'pm_score': 3, 'selected': True, 'text': '<p>If you use a static instance field that you initialize in your cpp file, you can get multiple instances (and even worse behavior) if the initialization of some static/global tries to get an instance of your singleton. This is because the order of static initialization across compilation units is undefined.</p>\n'}]
['https://Stackoverflow.com/questions/60331', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2167252/']