cadnano2 port to C++