c++ implementation of minidc