Improve C++ example