title: How to implement Copy-on-Write?
body: <p>I want to implement a copy-on-write on my custom C++ String class, and I wonder how to.</p>
  <p>I tried to implement some options, but they all turned out very inefficient.</p>