• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.. title:: clang-tidy - modernize-shrink-to-fit
2
3modernize-shrink-to-fit
4=======================
5
6
7Replace copy and swap tricks on shrinkable containers with the
8``shrink_to_fit()`` method call.
9
10The ``shrink_to_fit()`` method is more readable and more effective than
11the 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