How would it be done in C++ (curious, curious, don't really use C++)