Are time complexity of followng codes equivalent? Implemented is done in C++.

Supposing we have defined a class T with no restrictions and three functions cond, next and f returning bool, void and anything respectively, are

for(T k = T(); cond(); next())
    f();


and

{
T k = T();

while(cond()) {
    f();
    next();
}
}


So, I would like know that time complexity of the following algorithms are same?
I'm not familiar with C++ but it looks like that both codes are equivalent, for loop and while loop has the same power.

In your examples, in both cases you first you initial the variable k, and  the loop doesn't stop as coud() condition holds, inside the loop there is a call to f(); method, and finally to next();.