23 lines · plain
1.. title:: clang-tidy - boost-use-to-string2 3boost-use-to-string4===================5 6This check finds conversion from integer type like ``int`` to7``std::string`` or ``std::wstring`` using ``boost::lexical_cast``,8and replace it with calls to ``std::to_string`` and ``std::to_wstring``.9 10It doesn't replace conversion from floating points despite the ``to_string``11overloads, because it would change the behavior.12 13 14.. code-block:: c++15 16 auto str = boost::lexical_cast<std::string>(42);17 auto wstr = boost::lexical_cast<std::wstring>(2137LL);18 19 // Will be changed to20 auto str = std::to_string(42);21 auto wstr = std::to_wstring(2137LL);22 23