cpp implement