64-bit: size of vectors and the like
11 May
2014
11 May
'14
8:23 p.m.
Hi all,
TL,DR: please use std::size_t instead of e.g. unsigned int for STL's size() return values.
A quick message. I just fixed a bug in buildtool.cpp that lead to an infinite loop when compiled for 64-bit. It happened because of a loop test on a string.size() with an unsigned int counter type. Changing the counter type to std::size_t fixed the issue. To be honest, I do not actually fully understand why it went into an infinite loop. But hope this is an example to motivate you to use the correct type to store / work with the result of STL's size() return parameters.
Thanks, Johan
3878
Age (days ago)
3878
Last active (days ago)
0 comments
1 participants
participants (1)
-
Johan Engelen