Single pass for substituition into the template

(*) increase speed
(*) correctness; the previous multi-pass will inject the generated code
into the template, leading to unpredictable result. For example, if the
default value is a string literal "/* init */", it will be replaced by
the initializer list