1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

second part of c++11 update. gcc 4.5 and VS 2010 are no longer supported

- BOOST_FOREACH -> for
- replaced several boost classes with std (e.g. unordered)
- removed gcc-4.5 workarounds
- ran clang c++11 migration tool to detect some cases:
- - pointer initialized with "0" to nullptr
- - replace for with iterators with range-based for
- - use auto in some situations (type name specified twice, avoid long iterators type names)
This commit is contained in:
Ivan Savenko
2013-06-29 13:05:48 +00:00
parent 262f956a16
commit f82122d9be
88 changed files with 2065 additions and 2062 deletions

View File

@ -71,7 +71,7 @@ void SettingsStorage::init()
void SettingsStorage::invalidateNode(const std::vector<std::string> &changedPath)
{
BOOST_FOREACH(SettingsListener * listener, listeners)
for(SettingsListener * listener : listeners)
listener->nodeInvalidated(changedPath);
JsonNode savedConf = config;
@ -87,7 +87,7 @@ void SettingsStorage::invalidateNode(const std::vector<std::string> &changedPath
JsonNode & SettingsStorage::getNode(std::vector<std::string> path)
{
JsonNode *node = &config;
BOOST_FOREACH(std::string& value, path)
for(std::string& value : path)
node = &(*node)[value];
return *node;
@ -187,7 +187,7 @@ static void setButton(ButtonInfo &button, const JsonNode &g)
if (!g["additionalDefs"].isNull()) {
const JsonVector &defs_vec = g["additionalDefs"].Vector();
BOOST_FOREACH(const JsonNode &def, defs_vec) {
for(const JsonNode &def : defs_vec) {
button.additionalDefs.push_back(def.String());
}
}
@ -214,7 +214,7 @@ void config::CConfigHandler::init()
const JsonNode config(ResourceID("config/resolutions.json"));
const JsonVector &guisettings_vec = config["GUISettings"].Vector();
BOOST_FOREACH(const JsonNode &g, guisettings_vec)
for(const JsonNode &g : guisettings_vec)
{
std::pair<int,int> curRes(g["resolution"]["x"].Float(), g["resolution"]["y"].Float());
GUIOptions *current = &conf.guiOptions[curRes];