Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/docs/ClangFormatStyleOptions.rst
Show First 20 Lines • Show All 1,185 Lines • ▼ Show 20 Lines | * ``SLS_Empty`` (in configuration: ``Empty``) | ||||
.. code-block:: c++ | .. code-block:: c++ | ||||
auto lambda = [](int a) {}; | auto lambda = [](int a) {}; | ||||
auto lambda2 = [](int a) { | auto lambda2 = [](int a) { | ||||
return a; | return a; | ||||
}; | }; | ||||
* ``SLS_Inline`` (in configuration: ``Inline``) | * ``SLS_Inline`` (in configuration: ``Inline``) | ||||
Merge lambda into a single line if argument of a function. | Merge lambda into a single line if the lambda is argument of a function. | ||||
.. code-block:: c++ | .. code-block:: c++ | ||||
auto lambda = [](int a) { | auto lambda = [](int x, int y) { | ||||
return a; | return x < y; | ||||
}; | }; | ||||
sort(a.begin(), a.end(), []() { return x < y; }); | sort(a.begin(), a.end(), [](int x, int y) { return x < y; }); | ||||
* ``SLS_All`` (in configuration: ``All``) | * ``SLS_All`` (in configuration: ``All``) | ||||
Merge all lambdas fitting on a single line. | Merge all lambdas fitting on a single line. | ||||
.. code-block:: c++ | .. code-block:: c++ | ||||
auto lambda = [](int a) {}; | auto lambda = [](int a) {}; | ||||
auto lambda2 = [](int a) { return a; }; | auto lambda2 = [](int a) { return a; }; | ||||
▲ Show 20 Lines • Show All 3,679 Lines • Show Last 20 Lines |