String Metaprogramming

Tamas via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 18 10:09:26 PDT 2015


> Thanks  Nicholas , I have integrated some of your advice on the 
> edited code i.e. foreach and ref in pattern . Hope I fully 
> understood  what you meant. Am yet to look whether I still need 
> to change the signature . I have heared there are two 
> approaches to this, Where does one really draw the line between 
> CTFE and Template metaprogramming?

Template metaprogramming == "abuse the template facility in C++ 
to run a program in compile time" used to be the only way to 
execute something at compile time in C++. In D you don't want to 
do that as writing such code is a matter of putting an enum or 
static at the right place. Still, you can use templates to 
achieve your goal, if that helps.



More information about the Digitalmars-d-learn mailing list