[PATCH] D83431: [Docs] CodingStandards: for_each is discouraged
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 8 15:00:10 PDT 2020
lebedev.ri created this revision.
lebedev.ri added reviewers: dblaikie, nickdesaulniers.
lebedev.ri added a project: LLVM.
As per lengthy/heated disscussion in D83351 <https://reviews.llvm.org/D83351>,
using `for_each` is potentially confusing,
and it is therefore should be avoided.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D83431
Files:
llvm/docs/CodingStandards.rst
Index: llvm/docs/CodingStandards.rst
===================================================================
--- llvm/docs/CodingStandards.rst
+++ llvm/docs/CodingStandards.rst
@@ -1302,6 +1302,8 @@
for (Instruction &I : *BB)
... use I ...
+Usage of ``std::for_each()``/``llvm::for_each()`` functions is discouraged.
+
Don't evaluate ``end()`` every time through a loop
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83431.276565.patch
Type: text/x-patch
Size: 431 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200708/800ebdc3/attachment.bin>
More information about the llvm-commits
mailing list