C++ port of abcpp