Can you do the same in C++ ?