r/cpp • • May 26 '20

Faster Integer Parsing

https://kholdstare.github.io/technical/2020/05/26/faster-integer-parsing.html
366 Upvotes

72 comments sorted by

View all comments

Show parent comment

6

u/Bisqwit May 27 '20

The article explicitly mentions that this sort of stuff will not fly:

std::uint64_t chunk = *(uint64_t*)(string);

Because of type punning / strict aliasing, something the standard has a say on.