First version of the C++ example.