5 ms·
string_view would definitely have been wrong. std::span did not exist in the Standard at the time std::from_chars was adopted. An overload that takes std::spa
by pencilguin 4y ago
string_view would definitely have been wrong.
std::span did not exist in the Standard at the time std::from_chars was adopted.
An overload that takes std::span would be easy, and harmless. But as std::from_chars is only ever used from within some other abstraction, any benefit would be minimal.
- planede 4y agoWhy would string_view be wrong there?
- pencilguin 4y agoBecause, then, to parse out a number you would first need to get it into a string.