summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst')
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst b/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst
new file mode 100644
index 00000000000..ebeb82916c8
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst
@@ -0,0 +1,22 @@
+.. title:: clang-tidy - boost-use-to-string
+
+boost-use-to-string
+===================
+
+This check finds conversion from integer type like ``int`` to ``std::string`` or
+``std::wstring`` using ``boost::lexical_cast``, and replace it with calls to
+``std::to_string`` and ``std::to_wstring``.
+
+It doesn't replace conversion from floating points despite the ``to_string``
+overloads, because it would change the behaviour.
+
+
+ .. code-block:: c++
+
+ auto str = boost::lexical_cast<std::string>(42);
+ auto wstr = boost::lexical_cast<std::wstring>(2137LL);
+
+ // Will be changed to
+ auto str = std::to_string(42);
+ auto wstr = std::to_wstring(2137LL);
+
OpenPOWER on IntegriCloud