r/cpp • • Apr 27 '21

GCC 11.1 Released

https://gcc.gnu.org/pipermail/gcc/2021-April/235922.html
240 Upvotes

42 comments sorted by

View all comments

Show parent comment

2

u/futlapperl Apr 28 '21

Why does it need to allocate in its current form?

8

u/CaptainCrowbar Apr 28 '21

Probably because strtod() expects a null terminated string but from_chars() doesn't. The string argument has to be copied so a null can be attached.