C++, how to change class of object in runtime.

There is a nice feature in TIScript that allows to change class of already instantiated object. Let’s say we have two classes: class MyWidget : Behavior { … } class MyWidgetReadonly : Behavior { … } that handle user interaction with some widget on the screen. This widget can operate in two distinct modes: normal…