rewrite c++ generator to use new stencil engine