update c++ template code, include more header files