summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy/checks/modernize-shrink-to-fit.rst
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy/checks/modernize-shrink-to-fit.rst')
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/modernize-shrink-to-fit.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-shrink-to-fit.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-shrink-to-fit.rst
new file mode 100644
index 00000000000..6bc192e10c2
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-shrink-to-fit.rst
@@ -0,0 +1,10 @@
+readability-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.
OpenPOWER on IntegriCloud