diff options
author | Tobias Markmann <tm@ayena.de> | 2016-11-23 07:09:39 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-11-23 11:30:02 (GMT) |
commit | e405ff3561be3d3c0bd79d7d5173923a8828cf02 (patch) | |
tree | 9118ef838ebfaec1df90ec24761944b5d833774c /Sluift/main.cpp | |
parent | 8a71b91be885652f37c5aab5e1ecf25af4599fbc (diff) | |
download | swift-e405ff3561be3d3c0bd79d7d5173923a8828cf02.zip swift-e405ff3561be3d3c0bd79d7d5173923a8828cf02.tar.bz2 |
Migrate remaining Swiften/Base/foreach.h use to range-based for loop
Test-Information:
Build on macOS 10.12.1 and all tests pass.
Change-Id: Iedaa3fa7e7672c77909fd0568bf30e9393cb87e0
Diffstat (limited to 'Sluift/main.cpp')
-rw-r--r-- | Sluift/main.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Sluift/main.cpp b/Sluift/main.cpp index 05c7179..65d6d60 100644 --- a/Sluift/main.cpp +++ b/Sluift/main.cpp @@ -4,18 +4,21 @@ * See the COPYING file for more information. */ +#include <iostream> #include <string> #include <vector> -#include <iostream> -#include <lua.hpp> -#include <Swiften/Base/foreach.h> -#include <Swiften/Base/Platform.h> + +#include <boost/assign/list_of.hpp> +#include <boost/numeric/conversion/cast.hpp> +#include <boost/program_options.hpp> #include <boost/program_options/options_description.hpp> #include <boost/program_options/variables_map.hpp> -#include <boost/program_options.hpp> #include <boost/version.hpp> -#include <boost/numeric/conversion/cast.hpp> -#include <boost/assign/list_of.hpp> + +#include <lua.hpp> + +#include <Swiften/Base/Platform.h> + #include <Sluift/globals.h> #include <Sluift/Console.h> #include <Sluift/StandardTerminal.h> @@ -87,7 +90,7 @@ static void runScript(lua_State* L, const std::string& script, const std::vector // Load file checkResult(L, luaL_loadfile(L, script.c_str())); - foreach (const std::string& scriptArgument, scriptArguments) { + for (const auto& scriptArgument : scriptArguments) { lua_pushstring(L, scriptArgument.c_str()); } checkResult(L, Console::call(L, boost::numeric_cast<int>(scriptArguments.size()), false)); @@ -163,7 +166,7 @@ int main(int argc, char* argv[]) { lua_getglobal(L, "sluift"); std::vector<std::string> globalImports = boost::assign::list_of ("help")("with"); - foreach (const std::string& globalImport, globalImports) { + for (const auto& globalImport : globalImports) { lua_getfield(L, -1, globalImport.c_str()); lua_setglobal(L, globalImport.c_str()); } |