Category : flow

Say I have something like this: void myFunk(std::vector<T>& v, std::vector<T>::iterator first, std::vector<T>::iterator last) { while (first != last) { if ((*first) > (*last)) { T someT; v.push_back(someT); } first++; } } int main(){ std::vector<T> foo = {some, T, values}; myFunky(foo, foo.begin(), foo.end()) return 0; } Would this lead to an infinite loop, or would it ..

Read more