diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-06 11:08:21 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-11 23:17:18 +0200 |
commit | aa37e67ef7f5ff22da0ef95fb5221bc1fff9b3ca (patch) | |
tree | be5e1a9733987aed8602eb47618cd1673a594570 /qmake/generators/makefile.cpp | |
parent | fd2685c2f0a219c091e028a98ba6cdd154986fec (diff) |
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace, with manual
unstaging of the actual definition and documentation in dist/,
src/corelib/doc/ and src/corelib/global/.
Task-number: QTBUG-99313
Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r-- | qmake/generators/makefile.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index e94d088a3f..f705a9bfee 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1031,7 +1031,7 @@ MakefileGenerator::writeProjectMakefile() //install t << "install: "; - for (SubTarget *s : qAsConst(targets)) + for (SubTarget *s : std::as_const(targets)) t << s->target << '-'; t << "install " << Qt::endl; @@ -1961,7 +1961,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if (raw_clean.isEmpty()) raw_clean << tmp_out; QString tmp_clean; - for (const QString &rc : qAsConst(raw_clean)) + for (const QString &rc : std::as_const(raw_clean)) tmp_clean += ' ' + escapeFilePath(Option::fixPathToTargetOS(rc)); QString tmp_clean_cmds = project->values(ProKey(*it + ".clean_commands")).join(' '); if(!tmp_inputs.isEmpty()) @@ -1986,7 +1986,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) { QString tinp = (*input).toQString(); QString out = replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell); - for (const QString &rc : qAsConst(raw_clean)) { + for (const QString &rc : std::as_const(raw_clean)) { dels << ' ' + escapeFilePath(fileFixify( replaceExtraCompilerVariables(rc, tinp, out, NoShell), FileFixifyFromOutdir)); @@ -1997,7 +1997,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } else { QString files; const int commandlineLimit = 2047; // NT limit, expanded - for (const QString &file : qAsConst(dels)) { + for (const QString &file : std::as_const(dels)) { if(del_statement.size() + files.size() + qMax(fixEnvVariables(file).size(), file.size()) > commandlineLimit) { cleans.append(files); @@ -2263,11 +2263,11 @@ QString MakefileGenerator::buildArgs(bool withExtra) { QString ret; - for (const QString &arg : qAsConst(Option::globals->qmake_args)) + for (const QString &arg : std::as_const(Option::globals->qmake_args)) ret += " " + shellQuote(arg); if (withExtra && !Option::globals->qmake_extra_args.isEmpty()) { ret += " --"; - for (const QString &arg : qAsConst(Option::globals->qmake_extra_args)) + for (const QString &arg : std::as_const(Option::globals->qmake_extra_args)) ret += " " + shellQuote(arg); } return ret; |