What's the difference between std::to_string, boost::to_string, and boost::lexical_cast<std::string>?
What's the purpose of boost::to_string (found in boost/exception/to_string.hpp ) and how does it differ from boost::lexical_cast<std::string> and std::to_string ? std::to_string , available since C++11, works on fundamental numeric types specifically. It also has a std::to_wstring variant. It is designed to produce the same results that sprintf would. You may choose this form to avoid dependencies on external libraries/headers. The throw-on-failure function boost::lexical_cast<std::string> and its non-throwing cousin boost::conversion::try_lexical_convert work on any type that can be inserted