mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Add DISABLE_CLASS_COPY macro (and use it)
Use this macro to disallow copying of an object using the assignment operator or copy constructor. This catches otherwise silent-but-deadly mistakes such as "ServerMap map = env->getMap();" at compile time. If so desired, it is still possible to copy a class, but it now requires an explicit call to memcpy or std::copy.
This commit is contained in:
@@ -137,6 +137,7 @@ protected:
|
||||
private:
|
||||
Mutex m_time_lock;
|
||||
|
||||
DISABLE_CLASS_COPY(Environment);
|
||||
};
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user