1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[C++11] Suggest placing callable arguments as the last argument to

facilitate the nice formatting of lambdas passed there. Suggested by
Chris during review of my lambda additions, and something I strongly
agree with.

llvm-svn: 202622
This commit is contained in:
Chandler Carruth 2014-03-02 09:13:39 +00:00
parent b0056a4ca7
commit bb650c75f6

View File

@ -481,6 +481,10 @@ by the preceding part of the statement:
return a.bam < b.bam; return a.bam < b.bam;
}); });
To take best advantage of this formatting, if you are designing an API which
accepts a continuation or single callable argument (be it a functor, or
a ``std::function``), it should be the last argument if at all possible.
If there are multiple multi-line lambdas in a statement, or there is anything If there are multiple multi-line lambdas in a statement, or there is anything
interesting after the lambda in the statement, indent the block two spaces from interesting after the lambda in the statement, indent the block two spaces from
the indent of the ``[]``: the indent of the ``[]``: