Add a deep-copy copy constructor to Buffer. main creates b as a copy of a, then modifies b.data[0] –
with a correct deep copy, that change should be completely invisible to a, since they now own two entirely
separate arrays with (initially) equal contents.
If a.data[0] also ends up 999 in your output, the copy is shallow – both objects are still sharing one array.