tidy - boost-use-to-string — Extra Clang Tools 22.0.0git documentation (original) (raw)

boost-use-to-string

This check finds conversion from integer type like int tostd::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_stringoverloads, because it would change the behavior.

auto str = boost::lexical_caststd::string(42); auto wstr = boost::lexical_caststd::wstring(2137LL);

// Will be changed to auto str = std::to_string(42); auto wstr = std::to_wstring(2137LL);