Note that both the do_analysis
function and the railroad_car
class contain readily seen new
delete
combinations.
Readily seen new
delete
combinations is indicative of good
programming practice, because you can determine at a glance that memory
allocated by a new
is eventually reclaimed by a delete
.
Thus, you can determine at a glance that the new
does not cause a
memory leak.
The lack of such pairing is considered extremely bad, because it makes memory management much more difficult.