Add c++ implementation.