c********e 发帖数: 383 | 1 dont know how smart compiler is:
for example:
my_map::iter iter;
for (iter = map.upper_bound(key);
iter != map.lower_bound (key);
++iter)
{
//traverse element, all const/irrelavant func to map
}
will the lower_bound call be optimized when loop-invariant is turned on?
what about this case?
my_map::iter iter;
for (iter = map.upper_bound(key);
iter != map.lower_bound (key); | X****r 发帖数: 3557 | 2 Look again? I think it is.
【在 c********e 的大作中提到】 : dont know how smart compiler is: : for example: : my_map::iter iter; : for (iter = map.upper_bound(key); : iter != map.lower_bound (key); : ++iter) : { : //traverse element, all const/irrelavant func to map : } : will the lower_bound call be optimized when loop-invariant is turned on?
|
|