[Issue 3081] unaryFun can't be used to get element out of struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 20 10:13:44 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3081





--- Comment #4 from Jarrett Billingsley <jarrett.billingsley at gmail.com>  2009-06-20 10:13:42 PDT ---
(In reply to comment #3)
> Yeah, .stringof shouldn't be used there. But we still can get to the type
> through the alias. Changing the mixin string to
> enum testAsExpression = "{ ElementType "~parmName~"; return ("~fun~");}()"; 
> should fix the bug.

I can confirm that does work.

That being said, the amount of acrobatics that had to be performed to make the
templates involved not directly refer to the type at hand is somewhat
frightening.  It reminds me of implementing something by using lambdas several
layers deep.  This stuff probably has a limit, if not in what it can do, then
in the cognitive load on the programmers using it.  Too bad macros were
scrapped for D2, huh?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list