The general format is a combination of fixed and scientific so it handles regular floating point string with the additional support for e+num syntax.

A Bit About Performance

I did some benchmarking and the new routines are blazing fast!

Some numbers:

On GCC it’s ~4.5x faster than stoi, 2.2x faster than atoi and almost 50x faster than istringstream.

On Clang it’s ~3.5x faster than stoi, 2.7x faster than atoi and 60x faster than istringstream!

MSVC performs ~3x faster than stoi, ~2x faster than atoi and almost 50x faster than istringstream

The whole benchmark might, however, be a story for another post, so I’m not sharing the code yet.

Summary

If you want to convert text into a number and you don’t need any extra stuff like locale support then std::from_chars might be the best choice. It offers great performance, and what’s more, you’ll get a lot of information about the conversion process (for example, how many characters were scanned).