Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
boost::lexical_cast is a Boost function to convert to/from std::string to/from (possibly) any data type. CanLexicalCast can check if this conversion is possible.
The C++11 equivalent to convert to a std::string is std::to_string.
#include <string> |
LexicalCast serves the same purpose as boost::lexical_cast, but does not use Boost and does not throw an exception when conversion fails. Note that there are differences between LexicalCast and boost::lexical_cast, as boost::lexical_cast is more strict.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.