From 14479b2289f7396092982aecb668431986dd0dd0 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 19 Feb 2022 13:55:03 +0000 Subject: [PATCH] Make const data members non-const As recommended by C++ Core Guidelines C.12. Plugin and Game are still non-copy-constructable or assignable due to having members that are non-copy-constructable/assignable, but consistency is still good. --- include/loot/exception/cyclic_interaction_error.h | 2 +- include/loot/exception/undefined_group_error.h | 2 +- src/api/game/game.h | 4 ++-- src/api/plugin.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/loot/exception/cyclic_interaction_error.h b/include/loot/exception/cyclic_interaction_error.h index 10b56d83..8c195fc7 100644 --- a/include/loot/exception/cyclic_interaction_error.h +++ b/include/loot/exception/cyclic_interaction_error.h @@ -54,7 +54,7 @@ public: LOOT_API std::vector GetCycle(); private: - const std::vector cycle_; + std::vector cycle_; }; } diff --git a/include/loot/exception/undefined_group_error.h b/include/loot/exception/undefined_group_error.h index f43b36a4..6ba6ae86 100644 --- a/include/loot/exception/undefined_group_error.h +++ b/include/loot/exception/undefined_group_error.h @@ -50,7 +50,7 @@ public: LOOT_API std::string GetGroupName() { return groupName_; } private: - const std::string groupName_; + std::string groupName_; }; } diff --git a/src/api/game/game.h b/src/api/game/game.h index abc4df18..31322390 100644 --- a/src/api/game/game.h +++ b/src/api/game/game.h @@ -81,8 +81,8 @@ public: private: void CacheArchives(); - const GameType type_; - const std::filesystem::path gamePath_; + GameType type_; + std::filesystem::path gamePath_; GameCache cache_; LoadOrderHandler loadOrderHandler_; diff --git a/src/api/plugin.h b/src/api/plugin.h index a7f864ea..49710679 100644 --- a/src/api/plugin.h +++ b/src/api/plugin.h @@ -84,7 +84,7 @@ private: const std::filesystem::path& pluginPath); static unsigned int GetEspluginGameId(GameType gameType); - const std::string name_; + std::string name_; std::unique_ptr<::Plugin, decltype(&esp_plugin_free)> esPlugin; bool isEmpty_; // Does the plugin contain any records other than the TES4 // header?