Skip to content
Snippets Groups Projects
  • kwolekr's avatar
    c56d7fe0
    Add DISABLE_CLASS_COPY macro (and use it) · c56d7fe0
    kwolekr authored
    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.
    c56d7fe0
    History
    Add DISABLE_CLASS_COPY macro (and use it)
    kwolekr authored
    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.