pushing the boundaries of my understanding of c++