springlobby/springlobby — pull request #271 by MajBoredom (2014-08-26 23:53:51+00:00)
Title: Cleans up & improves some of the replay internals.

This doesn't change any functionality but it makes the code more robust and adds some protection against bugs in the replay code.

Prior to this commit, IBattle is marked as boost::noncopyable but its derived class OfflineBattle has a copy assignment operator=() defined. This violates the contract by overriding it but does not give compiler warnings.

With c++11, there are two additional ways of using noncopyable code: one is to use the =delete syntax to mark the copy constructor and copy assignment as invalid, the second is to supplement the class with move constructors and move assignments so that basic passing/returning of the object can still take place.

This commit adds both of these facilities to OfflineBattle and its ancestor UserList. It also provides some fields that were missing in the previous OfflineBattle copy assignment operator, and updates some calling code in the GUI to use const references instead of copying the object.

There is still some cleanup to do with IBattle since the c++11 method is preferable to boost::noncopyable, but it is an interface and so I held off on modifying it because it is used elsewhere.