forked from qt-creator/qt-creator
Coding style: Allow empty lambda parameter lists to be omitted
Change-Id: I6d4e53c5e16b1f25db62a4996fcc3b0298abd720 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -805,16 +805,6 @@
|
|||||||
Format the lambda according to the following rules:
|
Format the lambda according to the following rules:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
\li Always write parentheses for the parameter list, even if the function does not take
|
|
||||||
parameters.
|
|
||||||
\code
|
|
||||||
[]() { doSomething(); }
|
|
||||||
|
|
||||||
-NOT
|
|
||||||
|
|
||||||
[] { doSomething(); }
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
\li Place the capture-list, parameter list, return type, and opening brace on the first line,
|
\li Place the capture-list, parameter list, return type, and opening brace on the first line,
|
||||||
the body indented on the following lines, and the closing brace on a new line.
|
the body indented on the following lines, and the closing brace on a new line.
|
||||||
\code
|
\code
|
||||||
@@ -859,9 +849,9 @@
|
|||||||
|
|
||||||
\li Optionally, place the lambda completely on one line if it fits.
|
\li Optionally, place the lambda completely on one line if it fits.
|
||||||
\code
|
\code
|
||||||
foo([]() { return true; });
|
foo([] { return true; });
|
||||||
|
|
||||||
if (foo([]() { return true; })) {
|
if (foo([] { return true; })) {
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
\endcode
|
\endcode
|
||||||
|
Reference in New Issue
Block a user