bolt/deps/llvm-18.1.8/clang-tools-extra/docs/clang-tidy/checks/modernize/shrink-to-fit.rst

13 lines
419 B
ReStructuredText
Raw Normal View History

2025-02-14 19:21:04 +01:00
.. title:: clang-tidy - modernize-shrink-to-fit
modernize-shrink-to-fit
=======================
Replace copy and swap tricks on shrinkable containers with the
``shrink_to_fit()`` method call.
The ``shrink_to_fit()`` method is more readable and more effective than
the copy and swap trick to reduce the capacity of a shrinkable container.
Note that, the ``shrink_to_fit()`` method is only available in C++11 and up.