.cpp generator works only constructor and destructor