[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang-tools-extra / docs / clang-tidy / checks / boost / use-to-string.rst
blob8365e80fb95a3ce3d98b33b5bf1d5e11b458de19
1 .. title:: clang-tidy - boost-use-to-string
3 boost-use-to-string
4 ===================
6 This check finds conversion from integer type like ``int`` to ``std::string`` or
7 ``std::wstring`` using ``boost::lexical_cast``, and replace it with calls to
8 ``std::to_string`` and ``std::to_wstring``.
10 It doesn't replace conversion from floating points despite the ``to_string``
11 overloads, because it would change the behavior.
14 .. code-block:: c++
16     auto str = boost::lexical_cast<std::string>(42);
17     auto wstr = boost::lexical_cast<std::wstring>(2137LL);
19     // Will be changed to
20     auto str = std::to_string(42);
21     auto wstr = std::to_wstring(2137LL);