[Libreoffice] final and override

Stephan Bergmann sbergman at redhat.com
Mon Nov 28 02:42:15 PST 2011


On 11/28/2011 11:25 AM, Michael Meeks wrote:
> 	On the other hand; I'd (personally) prefer to use some defines to
> create the 'override' and 'final' keywords (as they will be in future).
> Defining them to 'virtual' or even empty would do, if they are not
> present in the compiler. cf. glib's provision of a stock 'inline'.
>
> 	That should help reduce code thrash, and hideous ugliness ;-) keeping
> us closer to more readable, standard C++.

One nitpick:  While it would keep the code surely more readable, it 
would make it less standard.  For one, override and final are 
technically not keywords in C++11, so a correct program that used them 
as identifiers would be broken if we defined them to be empty (for a 
compiler not yet supporting them).  For another, if override and final 
/were/ keywords, defining them in any way would result in undefined 
behaviour.

Stephan


More information about the LibreOffice mailing list