3 ms·
The advice about storing pointers in integers: http://cpphints.com/hints/7 http://cpphints.com/hints/7 is poor. It points out that converting a pointer value
by _kst_ 11y ago
The advice about storing pointers in integers:
http://cpphints.com/hints/7 http://cpphints.com/hints/7
is poor. It points out that converting a pointer value to "unsigned long" so you can perform arithmetic on it is a bad idea -- which is perfectly correct. But it advises just using a different integer type, such as "uintptr_t". The correct solution is to use pointer arithmetic. Don't store pointers in integers, store pointers in pointers; that's what they're for.
I've sent a comment to the author.