improve c/c++ template