From e9a2e8f88c67685ea6b894e8a4ae289067d0bfb7 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 4 Jan 2019 14:03:02 -0800 Subject: Added new LLSINGLETON macro that includes override keyword. --- indra/llcommon/llsingleton.h | 15 +++++++++++++++ indra/newview/llestateinfomodel.h | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'indra') 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 @@ -492,6 +492,17 @@ private: \ friend class LLSingleton; \ 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() + /** * Use LLSINGLETON_EMPTY_CTOR(Foo); at the start of an LLSingleton * 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 diff --git a/indra/newview/llestateinfomodel.h b/indra/newview/llestateinfomodel.h index 85f9f91d86..2c89a85500 100644 --- a/indra/newview/llestateinfomodel.h +++ b/indra/newview/llestateinfomodel.h @@ -41,7 +41,7 @@ class LLViewerRegion; */ class LLEstateInfoModel : public LLSingleton { - LLSINGLETON(LLEstateInfoModel); + LLSINGLETON_C11(LLEstateInfoModel); LOG_CLASS(LLEstateInfoModel); public: -- cgit v1.2.3