dmet code in c++