2 ms·
Casting in C++ doesn't change an object's type. It changes the type of the reference or pointer through which the object is viewed. The run-time-type-info (RTTI
by kazinator 11y ago
Casting in C++ doesn't change an object's type. It changes the type of the reference or pointer through which the object is viewed. The run-time-type-info (RTTI) of the object is the same.
Lisp change-class really changes the type. (There are no typed references in Lisp that correspond to what's going on in C++ with up and down casting; the object is just the object.)