From cdd1de0854c5fd55f7e99c5546ccf7a7245927f5 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 8 Apr 2013 11:23:53 +0300 Subject: 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 --- sal/inc/sal/types.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sal') 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 -- cgit