diff options
author | Rider Linden <rider@lindenlab.com> | 2019-01-04 14:03:02 -0800 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2019-01-04 14:03:02 -0800 |
commit | e9a2e8f88c67685ea6b894e8a4ae289067d0bfb7 (patch) | |
tree | 068d5ff0094be1f429fe20d904aba159933e614d /indra/llcommon/llsingleton.h | |
parent | 1ee1a086ce5e771d0f0d1c1104bd46b7745f1d7d (diff) |
Added new LLSINGLETON macro that includes override keyword.
Diffstat (limited to 'indra/llcommon/llsingleton.h')
-rw-r--r-- | indra/llcommon/llsingleton.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index 859e271e26..d4938ed9b7 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -493,6 +493,17 @@ private: \ DERIVED_CLASS() /** + * A slight variance from the above, but includes the "override" keyword + */ +#define LLSINGLETON_C11(DERIVED_CLASS) \ +private: \ + /* implement LLSingleton pure virtual method whose sole purpose */ \ + /* is to remind people to use this macro */ \ + virtual void you_must_use_LLSINGLETON_macro() override {} \ + friend class LLSingleton<DERIVED_CLASS>; \ + DERIVED_CLASS() + +/** * Use LLSINGLETON_EMPTY_CTOR(Foo); at the start of an LLSingleton<Foo> * subclass body when the constructor is trivial: * @@ -510,4 +521,8 @@ private: \ /* LLSINGLETON() is carefully implemented to permit exactly this */ \ LLSINGLETON(DERIVED_CLASS) {} +#define LLSINGLETON_EMPTY_CTOR_C11(DERIVED_CLASS) \ + /* LLSINGLETON() is carefully implemented to permit exactly this */ \ + LLSINGLETON_C11(DERIVED_CLASS) {} + #endif |