1.. title:: clang-tidy - readability-use-std-min-max 2 3readability-use-std-min-max 4=========================== 5 6Replaces certain conditional statements with equivalent calls to 7``std::min`` or ``std::max``. 8Note: This may impact performance in critical code due to potential 9additional stores compared to the original if statement. 10 11Before: 12 13.. code-block:: c++ 14 15 void foo() { 16 int a = 2, b = 3; 17 if (a < b) 18 a = b; 19 } 20 21 22After: 23 24.. code-block:: c++ 25 26 void foo() { 27 int a = 2, b = 3; 28 a = std::max(a, b); 29 } 30