Compile Time versus Run Time

Martin Tschierschke via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 31 08:43:21 PDT 2017


As a rookie in D programming I try to understand the power of 
templated functions with compile time parameters. With DMD 2.074 
a compile time format
(auto output = format!("Print this %s")(var);)

was introduced, now we all know that very many of this format 
strings are immutable, so wouldn't it be cool to automatically 
detect this and use the compile time version?

Without the need to think about it and to use an other syntax?
Is this theoretically possible?

Regards mt.




More information about the Digitalmars-d-learn mailing list