cpp version

cpp version