From c56d7fe0eba7905b0a63c4a1cfe909988653c23d Mon Sep 17 00:00:00 2001 From: kwolekr Date: Tue, 27 Oct 2015 02:51:43 -0400 Subject: 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. --- src/map.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/map.h') diff --git a/src/map.h b/src/map.h index 78af8c8d3..78614d228 100644 --- a/src/map.h +++ b/src/map.h @@ -365,6 +365,8 @@ private: u32 m_unprocessed_count; u32 m_inc_trending_up_start_time; // milliseconds bool m_queue_size_timer_started; + + DISABLE_CLASS_COPY(Map); }; /* -- cgit v1.2.3