mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 12:44:48 +00:00
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:
parent
a4a1cec637
commit
722f319c50
@ -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);
|
||||
|
||||
/** Needed for vector::erase. */
|
||||
hotkey_command(hotkey_command&&) = default;
|
||||
hotkey_command& operator=(hotkey_command&&) = default;
|
||||
|
||||
/** This shouldn't be copyable. */
|
||||
hotkey_command(const hotkey_command&) = delete;
|
||||
hotkey_command(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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user