The Qt C++ library does some neat tricks to avoid copying. For example its vector class (like nearly all of its container&#x2F;value classes) overloads the &quot;=&quot; operator to perform shallow copies. So even though default behavior in C++ is to deep copy, it&#x27;s possible to override.<p>Qt even takes it further by providing automatic copy-on-write. Methods that read data operate on the shared copy. Methods that change data cause the object to deep copy and detach first. This allows writing programs using values rather than references, while retaining the performance of references.