mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 17:15:21 +02:00
C++11 patchset 6: forbid object copy using assigment/copy function deleters (#5945)
C++11 implement function deleting, it's generally used to prevent some object copy In script API use this function removal on ScriptApiBase instead of ScriptApiClient/Server/MainMenu, this affect all ScriptApis Move DISABLE_CLASS_COPY with constructor, the deleted function permit to replace function in its original place
This commit is contained in:
@@ -33,9 +33,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// 'Foobar', add the macro DISABLE_CLASS_COPY(Foobar) as a private member.
|
||||
// Note this also disables copying for any classes derived from 'Foobar' as well
|
||||
// as classes having a 'Foobar' member.
|
||||
#define DISABLE_CLASS_COPY(C) \
|
||||
C(const C &); \
|
||||
C &operator=(const C &)
|
||||
#define DISABLE_CLASS_COPY(C) \
|
||||
C(const C &) = delete; \
|
||||
C &operator=(const C &) = delete;
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#define UNUSED_ATTRIBUTE __attribute__ ((unused))
|
||||
|
Reference in New Issue
Block a user