Implementing Round Robin in C++