add C++ version