I\'m not sure if the following code can cause redundant calculations, or is it compiler-specific?
for (int i = 0; i < strlen(ss); ++i)
{
// blabla
}
<
The predicate code in it's entirety will be executed on every iteration of the for loop. In order to memoize the result of the strlen(ss) call the compiler would need to know that at least
strlen was side effect freess doesn't change for the duration of the loopThe compiler doesn't know either of these things and hence can't safely memoize the result of the first call