Monday, November 9, 2015

FeedaMail: Comments for Sutter’s Mill

feedamail.com Comments for Sutter's Mill

Comment on Reader Q&A: auto and for loop index variables by adam915

Hi all, I’m not sure about insert object.size() (or any other function) in for statement is good solution, i think the

auto object_size = object.size();  decltype(object_size) i = 0;  for (i = 0; i < object_size; i++) { … }

it’s better than

for (decltype(object.size()) i = 0; i < object.size(); i++) { … } 

because we don’t call object.size() function in every iteration (in second example, it’s called twice)

Read More »
 
Delievered to you by Feedamail.
Unsubscribe

No comments:

Post a Comment