How to implement Copy-on-Write?

Viewed 24734

I want to implement a copy-on-write on my custom C++ String class, and I wonder how to.

I tried to implement some options, but they all turned out very inefficient.

5 Answers
Related