Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

C++17's from_chars

$
0
0
I consider using the C++17's std::from_chars_result from_chars(const char* first, const char* last, ...); due to its nice error codes (including range checking, whereas strtof etc. need to call GetLastError ). I typically have three variants for converting a C string: convert the C string [first, implicit last) convert the C string [first, last) convert the C string [first, implicit last) prefix So for example, "10K" will be converted to an integer 10 in the last case. Is it somehow possible to do this as well with from_chars?

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>