From dc463d1c2c2431178012a961a35d3975f974e5d7 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 24 Sep 2012 23:18:57 +0100 Subject: [PATCH] Macro to disable the copy-constructor. Another toolkit I use has an explicit macro for this, which is nice for readability, so I've borrowed it here. --- simgear/sg_inlines.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/simgear/sg_inlines.h b/simgear/sg_inlines.h index 04df945e..f10090db 100644 --- a/simgear/sg_inlines.h +++ b/simgear/sg_inlines.h @@ -103,4 +103,10 @@ inline void SG_NORMALIZE_RANGE( T &val, const T min, const T max ) { // avoid an 'unused parameter' compiler warning. #define SG_UNUSED(x) (void)x +// easy way to disable the copy constructor and assignment operator +// on an object +#define SG_DISABLE_COPY(Class) \ + Class(const Class &); \ + Class &operator=(const Class &); + #endif // _SG_INLINES_H