Re: Automatic function body writing howto?

2017-08-17 Thread Oleg B via Digitalmars-d-learn
On Wednesday, 16 August 2017 at 22:48:59 UTC, Meta wrote: It's hard to tell offhand but I would recommend that you extract the inner string into a function that generates that string, allowing you to print out the finished product before mixing it in. It's have a same result...

Re: Automatic function body writing howto?

2017-08-16 Thread Meta via Digitalmars-d-learn
It's hard to tell offhand but I would recommend that you extract the inner string into a function that generates that string, allowing you to print out the finished product before mixing it in.

Automatic function body writing howto?

2017-08-16 Thread Oleg B via Digitalmars-d-learn
I want declare only signature of function and build body code by CTFE. module mdl; import std.stdio; import std.traits; import std.string; enum autofnc; @autofnc { int foo(int); int bar(int); } void main() { writeln(foo(12)); } mixin cfuncR; mixin template cfuncR()