>>107668037
This is more legible than the original code, as evidenced by my own confusion as to what it was even trying to do.
bool process() {
std::vector phases = {p1, p2, p3, p4};
for(int i = 0; i < phases.size();) {
bool result = phases[i]();
if(i==0 && !result) return false;
if(result) i++;
}
return true;
}