title: cannot convert from 'const char *' to 'char *' for std::string::c_str
body: <p>This gives the error: cannot convert from 'const char *' to 'char *'.</p>
  
  <pre><code>class Mock
  {
  public:
      ...
      static void func(char **result)
      {
            *result = (resultsI++)-&gt;c_str();
      }
  static std::vector&lt;std::string&gt; results;
  static std::vector&lt;std::string&gt;::iterator resultsI;
  };
  
  std::vector&lt;std::string&gt; Mock::results;
  std::vector&lt;std::string&gt;::iterator Mock::resultsI;
  </code></pre>
  
  <p>How can I validly get rid of this error without changing the interface to the function func? The implementer of this interface:</p>
  
  <pre><code>void (func*)(char **result) 
  </code></pre>
  
  <p>forgot to use const char** in the signature. I can't change it.</p>
  
  <p>Remember this is a mock and I'm only used in my unit tests.</p>