From 8d7e913248aa1cad23447668d98911bba01faf4b Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 26 Jan 2016 14:38:54 +0100 Subject: qmake: eradicate Q_FOREACH loops [rvalues] ... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Change-Id: I5834620bf82f3442da7b2838363d351a0fb960a0 Reviewed-by: Lars Knoll --- qmake/generators/win32/msvc_vcproj.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qmake/generators/win32/msvc_vcproj.cpp') diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 3715a8cce4..837b1747bf 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1167,7 +1167,8 @@ void VcprojGenerator::initLinkerTool() static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 }; for (int i = 0; lflags[i]; i++) { - foreach (const ProString &lib, fixLibFlags(lflags[i])) { + const auto libs = fixLibFlags(lflags[i]); + for (const ProString &lib : libs) { if (lib.startsWith("/LIBPATH:")) conf.linker.AdditionalLibraryDirectories << lib.mid(9).toQString(); else -- cgit v1.2.3