[Libreoffice] final and override

Stephan Bergmann sbergman at redhat.com
Mon Nov 28 00:03:38 PST 2011


On 11/27/2011 08:58 PM, Noel Grandin wrote:
> I see the Mozilla project is adding MOZ_FINAL and MOZ_OVERRIDE macros
> to help control method overriding in their codebase
>
> http://whereswalden.com/2011/11/16/introducing-moz_override-to-annotate-virtual-functions-which-override-base-class-virtual-functions/
> http://whereswalden.com/2011/11/26/introducing-moz_final-prevent-inheriting-from-a-class-or-prevent-overriding-a-virtual-function/
>
> Would such things be useful additions to the LibreOffice codebase?

In principle, yes.  Like happened with features of the old C++ Standard 
that only made it slowly into the various compilers (the infamous 
VOS_NAMESPACE etc. stuff, e.g.), we will likely need macros for new 
features that can be enabled for compilers that already understand them, 
without breaking the code for legacy compilers.

However, given that override and final will only make it into GCC 4.7 
(according to <http://wiki.apache.org/stdcxx/C++0xCompilerSupport>), it 
might still be a bit early to address them.

Stephan


More information about the LibreOffice mailing list