How to Use The Newest C++ String Conversion Routines: std::from_chars

Intro

C++, before C++17, offered several options when it comes to string conversion:

  • sprintf / snprintf
  • sscanf
  • atol
  • strtol
  • strstream
  • stringstream
  • to_string
  • stoi and similar functions

And with C++17 you get another option: std::from_chars! Wasn’t the old stuff good enough? Why do we need new methods?