[cairo] Bindings and virtual functions

mental at rydia.net mental at rydia.net
Thu May 26 13:08:18 PDT 2005


Quoting Adam Lofts <adam.lofts at gmail.com>:

> For instance, overriding the Save and Restore calls would allow
> an application to preserve extra state information. This can of
> course be achieved without virtual functions, and just calling the
> functions something else - but having virtual functions adds to
the
> flexibility and clarity of the api. Neither is this a bug in Cairo
> since it cannot be aware of what the programmer wants to achieve
in
> overriding these calls.

Wouldn't that be better accomplished through explicit delegation
rather than inheritance?

Making the Cairo calls virtual seems misleading -- after all, if
save or restore were called via another language binding, the
overridden save or restore methods wouldn't get called anyway.

-mental




More information about the cairo mailing list