From b1253bfc74ca7cca555514fedd496b4be2b912f8 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 2 Mar 2021 14:51:46 +0000 Subject: [PATCH] Added JUCE_DECLARE_NON_MOVEABLE macro --- modules/juce_core/system/juce_PlatformDefs.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h index 43000cab6b..8df78273a4 100644 --- a/modules/juce_core/system/juce_PlatformDefs.h +++ b/modules/juce_core/system/juce_PlatformDefs.h @@ -190,7 +190,8 @@ namespace juce #define JUCE_STRINGIFY(item) JUCE_STRINGIFY_MACRO_HELPER (item) //============================================================================== -/** This is a shorthand macro for declaring stubs for a class's copy constructor and operator=. +/** This is a shorthand macro for deleting a class's copy constructor and + copy assignment operator. For example, instead of @code @@ -218,6 +219,13 @@ namespace juce className (const className&) = delete;\ className& operator= (const className&) = delete; +/** This is a shorthand macro for deleting a class's move constructor and + move assignment operator. +*/ +#define JUCE_DECLARE_NON_MOVEABLE(className) \ + className (className&&) = delete;\ + className& operator= (className&&) = delete; + /** This is a shorthand way of writing both a JUCE_DECLARE_NON_COPYABLE and JUCE_LEAK_DETECTOR macro for a class. */