summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-04-08 11:23:53 +0300
committerTor Lillqvist <tml@iki.fi>2013-04-08 11:46:10 +0300
commitcdd1de0854c5fd55f7e99c5546ccf7a7245927f5 (patch)
treea7240435c1ab3543cf76a2ba9526e54ece860c42 /sal
parent0a3fc0130166629209e98bea178905085098a8f2 (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')
-rw-r--r--sal/inc/sal/types.h12
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