Mixin helper help

John Chapman john.chapman at live.com
Sat Jan 14 18:57:21 UTC 2023


On Friday, 13 January 2023 at 14:32:44 UTC, Salih Dincer wrote:
> Why not directly use the mixin template for opDispatch()?

My opDispatch generates code based on the arguments passed, 
interpolating variable names and functions based on the type. I 
wanted to remove the double braces in my static foreach (needed 
as I declared some aliases inside but since it creates a scope 
those new variables can't be referred to outside of it). I saw 
Adam's post here 
http://dpldocs.info/this-week-in-d/Blog.Posted_2022_12_26.html 
showing use of a "helper" template, and I was trying to adapt it.

I've since just dropped the double braces and removed the 
aliases. It's not as clean but works.


More information about the Digitalmars-d-learn mailing list