[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Proposing the removal of virtual_hooks (or how you can add a
From:       Frans Englich <frans.englich () telia ! com>
Date:       2006-03-05 16:55:54
Message-ID: 200603051655.54401.frans.englich () telia ! com
[Download RAW message or body]

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:

+ Doesn't require QObject
- Requires one virtual function to be added.


Cheers,

		Frans
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic