Wrapper ported to c++