From b6f5bcb7dc817d305c9e2997ac4b66b662284697 Mon Sep 17 00:00:00 2001 From: Casey Link Date: Thu, 27 Nov 2014 13:28:17 +0100 Subject: [PATCH] stockpiles: fix compilation on windows VS2010 only supports a subset of C++11 --- plugins/stockpiles.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/stockpiles.cpp b/plugins/stockpiles.cpp index 0e395b0d7..f9f54a717 100644 --- a/plugins/stockpiles.cpp +++ b/plugins/stockpiles.cpp @@ -637,7 +637,7 @@ private: // importing FuncReadImport get_value; size_t serialized_count; - bool valid = false; + bool valid; food_pair ( FuncWriteExport s, std::vector* sp_v, FuncReadImport g, size_t count ) : set_value ( s ) @@ -646,7 +646,7 @@ private: , serialized_count ( count ) , valid ( true ) {} - food_pair() {} + food_pair(): valid( false ) {} }; /** @@ -2752,8 +2752,9 @@ static command_result savestock ( color_ostream &out, vector & paramete bool debug = false; std::string file; - for ( std::string o : parameters ) - { + for( size_t i = 0; i < parameters.size(); ++i ) + { + const std::string o = parameters.at(i); if ( o == "--debug" || o == "-d" ) debug = true; else if ( !o.empty() && o[0] != '-' ) @@ -2801,8 +2802,9 @@ static command_result loadstock ( color_ostream &out, vector & paramete bool debug = false; std::string file; - for ( std::string o : parameters ) - { + for( size_t i = 0; i < parameters.size(); ++i ) + { + const std::string o = parameters.at(i); if ( o == "--debug" || o == "-d" ) debug = true; else if ( !o.empty() && o[0] != '-' )