title: Singletons with constructor arguments
body: <p>While trying do create a single instance of a class which will require global access and <em>modification</em> to it's name, I have some <em>syntax</em> related issue (I think) with my code in the implementation file.</p>
  
  <p>When I compile, I get error on the return statement:</p>
  
  <blockquote>
    <p>non-const lvalue reference to type Single cannot bind to a value of unrelated type Single.</p>
  </blockquote>
  
  <p>single.h</p>
  
  <pre><code>class Single{
  public:
     std::string getSingleName();
     void updateSingleName(std::string name);
     void operator=(Single const&amp;) = delete;
     Single(Single const&amp;) = delete;
     static Single&amp; getInstance(const std::string&amp; name);
  
  private:
      Single(std::string singleName);  
      std::string name;
  };
  </code></pre>
  
  <p>Single.cpp</p>
  
  <pre><code>Single&amp; Single::getInstance(const std::string&amp; name){
       Single single(std::string name);
       return single;
  }
  </code></pre>