Make hotkeys copyable again

There is barely any point in moving hotkeys because the command is the only
member variable that's both 1) movable and 2) faster to move than copy. In
2cc3f99651c9de13eb36ab0c490996a8dd47e50e, @Vultraz talked about "avoiding hundreds of copies", but
moving isn't necessarily any faster than copying. Seriously, making hotkeys
noncopyable was just a premature and obviously unprofiled optimization.

Besides, this also fixes build on Visual Studio 2013.
This commit is contained in:
Jyrki Vesterinen 2017-11-22 08:42:41 +02:00
parent a4a1cec637
commit 722f319c50

View File

@ -238,12 +238,7 @@ struct hotkey_command
hotkey_command(HOTKEY_COMMAND cmd, const std::string& id, const t_string& desc, bool hidden, bool toggle, hk_scopes scope, HOTKEY_CATEGORY category, const t_string& tooltip); hotkey_command(HOTKEY_COMMAND cmd, const std::string& id, const t_string& desc, bool hidden, bool toggle, hk_scopes scope, HOTKEY_CATEGORY category, const t_string& tooltip);
/** Needed for vector::erase. */ hotkey_command(const hotkey_command&) = default;
hotkey_command(hotkey_command&&) = default;
hotkey_command& operator=(hotkey_command&&) = default;
/** This shouldn't be copyable. */
hotkey_command(const hotkey_command&) = delete;
hotkey_command& operator=(const hotkey_command&) = default; hotkey_command& operator=(const hotkey_command&) = default;
/// the names are strange: the "hotkey::HOTKEY_COMMAND" is named id, and the string to identify the object is called "command" /// the names are strange: the "hotkey::HOTKEY_COMMAND" is named id, and the string to identify the object is called "command"