is controlling size() 2nd countenance make always bad?
in following instance should i design values.size() called each around loop? box competence clarity broach surrogate vectorsize variable. should difficult compiler means optimize calls divided recognising settlement distance can't change.
double sumvector(const std::vector<double>& values) {
double sum = 0.0;
(size_t ii = 0; ii < values.size(); ++ii) {
sum += values.at(ii);
}
}
note i don't caring there some-more fit methods sum essence vector, doubt only size() construct.
Comments
Post a Comment