Closures not yet supported in CTFE's

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Jul 27 10:17:00 PDT 2013


On Sat, Jul 27, 2013 at 06:47:04PM +0200, JS wrote:
> When I try to pass a lambda to a template, I get the subject error.
> 
> (string x) => { return x~"1"; }

Drop the "=>", that syntax doesn't do what you think it does.


> But when I jsut do
> 
> (string x) => x~"1"
> 
> it works....
> 
> Come on!!!

Y'know, it would really help if you (1) show the full code that's
failing, and (2) calm down before posting to the forum.  I understand
that compiler bugs/limitations can be very aggravating, but you're much
more likely to get a helpful reply that way.


T

-- 
He who does not appreciate the beauty of language is not worthy to bemoan its flaws.


More information about the Digitalmars-d-learn mailing list