You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clang-tools-extra/docs/clang-tidy/checks/modernize/min-max-use-initializer-list.rst
+9-4Lines changed: 9 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,8 @@
3
3
modernize-min-max-use-initializer-list
4
4
======================================
5
5
6
-
Replaces nested ``std::min`` and ``std::max`` calls with an initializer list where applicable.
6
+
Replaces nested ``std::min`` and ``std::max`` calls with an initializer list
7
+
where applicable.
7
8
8
9
For instance, consider the following code:
9
10
@@ -20,9 +21,12 @@ The check will transform the above code to:
20
21
Performance Considerations
21
22
==========================
22
23
23
-
While this check simplifies the code and makes it more readable, it may cause performance degradation for non-trivial types due to the need to copy objects into the initializer list.
24
+
While this check simplifies the code and makes it more readable, it may cause
25
+
performance degradation for non-trivial types due to the need to copy objects
26
+
into the initializer list.
24
27
25
-
To avoid this, it is recommended to use `std::ref` or `std::cref` for non-trivial types:
28
+
To avoid this, it is recommended to use `std::ref` or `std::cref` for
29
+
non-trivial types:
26
30
27
31
.. code-block:: cpp
28
32
@@ -42,4 +46,5 @@ Options
42
46
43
47
.. option:: IgnoreTrivialTypesOfSizeAbove
44
48
45
-
An integer specifying the size (in bytes) above which trivial types are ignored. Default is `32`.
49
+
An integer specifying the size (in bytes) above which trivial types are
0 commit comments