13 lines · plain
1.. title:: clang-tidy - modernize-shrink-to-fit2 3modernize-shrink-to-fit4=======================5 6 7Replace copy and swap tricks on shrinkable containers with the8``shrink_to_fit()`` method call.9 10The ``shrink_to_fit()`` method is more readable and more effective than11the copy and swap trick to reduce the capacity of a shrinkable container.12Note that, the ``shrink_to_fit()`` method is only available in C++11 and up.13