title: returning a const char* from a function
body: <p>I have to replace some char array code.  So say I have a class that has an std::string member variable.</p>
  
  <pre><code>class foo
  {
  private:
    std::string _sBar;
  
  public:
    const char* getBar() const { return _sBar.c_str(); }
  };
  </code></pre>
  
  <p>existing code expects that <code>const char*</code>'s are returned in the string accessor functions, so I can't return a <code>const std::string</code> reference.  </p>
  
  <p>But isn't there some rule that when the stack unwinds that you can no longer trust the return value from the <code>_sBar.c_str()</code> ?</p>