title: Mutating copy of string and returning value instead of changing original string
body: <p>I have a recursive function which uses string and the operation i perform are </p>
  
  <pre><code>erase, replace, insert,..
  
  int method(original_string):
      ...
      min(operation1(original_string), operation2(original_string)) 
      ...
  </code></pre>
  
  <p>I want to keep the original string unchanged but rather need a mutated new string</p>
  
  <pre><code>mutate(original_string, operation) :
          temp = copyof(original_string)
          operation(temp);
          return temp;
  </code></pre>
  
  <p>Because the problem is operation1 affects original_string and i want the real original_string for operation2 too.</p>
  
  <p>But this is not possible for different functions, i need to write for each and every function.</p>
  
  <ul>
  <li>In C++ is something exists already or workaround possible to achieve this?</li>
  <li>I feel like defining string argument as const * original_string and expecting the operations to behave likewise.</li>
  </ul>