C++ version.