On the other hand, because r
is a call-by-reference parameter, any
kind of railroad car handed over, including a box car, is visible in full.
In particular, the virtual member function, short_name
, which is
defined in all the subclasses of the railroad_car
class, returns the
appropriate short name, be it box
, tnk
, eng
, or
cab
.