On Sat, 20 Apr 2013 15:14:14 GMT, Matej Nanut wrote:

But why doesn't the actual type work? Why musn't it be const?

Using just "render" seems to infer the types correctly?

The problem is that typeid(const(T)) !is typeid(T) and the type id is everything that renderCompat has to recover the original type. render!() on the other hand will just be a separate template instantiation (render!("...", <alias to const var>) vs. render!("...", <alias to non-const var>)) and as long as the Diet template doesn't try to write to the variable, everything will work fine (except that local aliases are still broken in DMD and may result in bad codegen).