Proposing the removal of virtual_hooks (or how you can add a virtual method without using "virtual")

Thiago Macieira thiago at kde.org
Sun Mar 5 16:50:45 GMT 2006


Frans Englich wrote:
>On Saturday 04 March 2006 11:18, Thiago Macieira wrote:
>> I'd like to propose a change of policy in the KDE libraries: remove
>> all virtual_hook functions from QObject-derived classes.
>>
>> The reason for that is that we *already* have a virtual_hook function
>> in those classes and it's called qt_metacall. It's automatically
>> generated by moc, so we're safe that it'll always exist.
>
>Another way to preserve BC is to use the visitor/double dispatch
> pattern. It can be argued to be a bit heavy code-wise, but achieves the
> goal and can also be fast, depending on various factors. Major
> pros/cons:

Would you mind elaborate on what that is?
-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

5. Swa he géanhwearf tó timbran, and hwonne he cóm, lá! Unix cwæð "Hello, 
World". Ǽfre ǽghwilc wæs glæd and seo woruld wæs fréo.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060305/3eb98962/attachment.sig>


More information about the kde-core-devel mailing list