[poppler] C++11 in poppler: adding override

Adam Reichold adam.reichold at t-online.de
Thu Feb 23 17:48:27 UTC 2017


Hello,

Am 22.02.2017 um 23:48 schrieb Albert Astals Cid:
> El dimecres, 22 de febrer de 2017, a les 18:37:16 CET, Carlos Garcia Campos va 
> escriure:
> What classes/methods we have that we know for sure final and should never be 
> overriden?

Marking something final could also be understood as "I do not think that
anyone overrides this one. Compiler, please go and check that for me."
instead of "This one should never, under any circumstances be
overriden.". In that case, the answer would be that everything with a
vtable should be final (in the internal code base at least) until
someone finds a need to override it.

This way, final will become a local hint to the global structure of the
code instead of the deliberate design choice to seal a type or method
implementation for good. I guess it is a question of style preferences
as to which interpretation is chosen.

Best regards, Adam.

P.S.:

> If noone disagrees strongly on March 8 i'll commit a patch adding override
> to the functions that override to make sure we don't forget something
> when changing one of the lots of virtual functions we have around.

I am not sure if it is worth the hassle, but since all of this is about
catching things at compile time and has little value at runtime, one
could create a define POPPLER_OVERRIDE that becomes empty on older
compilers not supporting C++11, so that this would not decrease compiler
coverage at all.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20170223/1d95a35f/attachment.sig>


More information about the poppler mailing list