Can change vtbl record at runtime ?

Виталий Фадеев vital.fadeev at gmail.com
Wed Feb 3 05:30:37 UTC 2021


Reason:
     Reuse component,
     bind custom callback without creating new class.

Concept example:
     class SaveFilePopup
     {
         void onSuccess() { /* default operations */ }
     }

     auto saveFile = new SaveFilePopup();
     saveFile.onSuccess = { /* New operations */ }

Delegate:
     may be... but, for speed reason, is possible to set the 
default code at compile-time ?

     class X
     {
        void delegate() onSuccess = { /* default code */ };
     }

Context:
     GUI, components, callbacks

Possible to change the vtbl record at runtime ?
Has functional for update vtbl records ?




More information about the Digitalmars-d-learn mailing list