Apologies if this was already asked. I couldn't find an answer to that. Is it legal to use an iterator as an offset index? For example:
for (list<T> iterator::it = v2->vals.begin(); it!=v2->vals.end();++i) {
v3.push_back(v2[it] + v1[it]);
}
where : const Vec& v2 and vals is a list in Vec class's protected.
Many thanks!
Aucun commentaire:
Enregistrer un commentaire