title: Replace all occurrences of the search string after specific position
body: <p>I'm looking for <em>replace all</em> algorithm which replaced all occurrences of substring after specific position. So far I have <code>replace all copy</code> approach. What is most convenient way to do it without allocation of new string except <a href="https://stackoverflow.com/a/24315631/532208">this one</a>? Does exist convenient way to do it with boost? </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;boost/algorithm/string/replace.hpp&gt;
  
  int main() {
      std::string str = "1234 abc1234 marker 1234 1234 123 1 12 134 12341234";
  
      const std::string marker("marker"); 
      size_t pos = str.find(marker);
      if (pos == std::string::npos) {
          return 0;
      }
      pos += marker.length();
      std::string str_out(str, 0, pos);
      boost::algorithm::replace_all_copy(std::back_inserter(str_out), str.substr(pos, std::string::npos), "12", "XXXX");
      std::cout &lt;&lt; str &lt;&lt;  std::endl;
      std::cout &lt;&lt; str_out &lt;&lt;  std::endl;
  }
  </code></pre>