update C and C++ templates