title: Check if instance exists and return reference in Singleton getInstance();
body: <p>I'm implementing Singleton the way described in the <a href="https://stackoverflow.com/questions/1008019/c-singleton-design-pattern/1008289#1008289">first answer here.</a> The getInstance() method returns a reference but what I'm not sure about is how I should create my new instance and check if it already exists before creating it and returning it.</p>
  
  <pre><code>class Song {
  
  private:
      Song song;
      Song();
      Song(Song const&amp;); // don't implement
      void operator = (Song const&amp;); //don't implement
  
  public:
      static Song &amp;getInstance();
  }
  </code></pre>
  
  <p>So what should my <code>getInstance();</code> implementation look like? I want to return the song member object if it already exists and otherwise create it and than return it. I know there's a n implementation in the link I added but I'm not sure it does what I want and I don't understand it very well.</p>
  
  <p>Also, could someone explain what these two lines are for and why the <code>=</code> operator is being overwritten?</p>
  
  <pre><code>    Song(Song const&amp;); // don't implement
      void operator = (Song const&amp;); //don't implement
  </code></pre>