After the while() loop above, itr2 will be pointing to the first empty cluster. If itr2->indices is not empty, it means that there's no empty cluster in original clusters_ .