diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-04-08 11:23:53 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-04-08 11:46:10 +0300 |
commit | cdd1de0854c5fd55f7e99c5546ccf7a7245927f5 (patch) | |
tree | a7240435c1ab3543cf76a2ba9526e54ece860c42 /sal/inc | |
parent | 0a3fc0130166629209e98bea178905085098a8f2 (diff) |
Check for the C++11 "final" specifier and introduce SAL_FINAL
I think it is useful to use SAL_FINAL mainly as a documentation aid,
to make it clear to a code reader when a class is not expected to be
derived from, and when a virtual function is not expected to be
overridden in a derived class.
Possibly there is also some class of bugs that using SAL_FINAL will
help find?
Change-Id: I45002f020dcb52e8a9f2962ff98780f2b80627af
Diffstat (limited to 'sal/inc')
-rw-r--r-- | sal/inc/sal/types.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h index 346abf6691d0..55f2e729ac8b 100644 --- a/sal/inc/sal/types.h +++ b/sal/inc/sal/types.h @@ -409,6 +409,18 @@ namespace css = ::com::sun::star; #define SAL_OVERRIDE #endif +/** C++11 "final" feature. + + With HAVE_CXX11_FINAL, mark a class as non-derivable or a method as non-overridable. + + @since LibreOffice 4.1 +*/ +#if HAVE_CXX11_FINAL +#define SAL_FINAL final +#else +#define SAL_FINAL +#endif + #endif /* __cplusplus */ #ifdef __cplusplus |