A kind of C++ magic