This Buffer looks well-written – a correct destructor, a correct copy constructor – and it’s still buggy. Run
it as-is: b = a; uses the compiler-generated default copy assignment operator, since none was written, and that
default is the same shallow copy from two lessons ago. a.data[0] ends up 999 even though only b.data[0] was
ever assigned to.
This is the Rule of Three’s real failure mode in practice: it’s rarely “forgot all three at once.” It’s usually
“wrote two of the three correctly, and the class still isn’t safe” – because all three are required together, not
individually. Add the missing operator=.