Re: passing member.member alias to mixin template

2017-09-03 Thread Eric_DD via Digitalmars-d-learn
Clear explanation, thanks! I think it would avoid a lot of confusion to disallow the alias f = c1.field notation and only allow the alias f = C.field notation. If necessary one could use alias f = typeof(c1).field

Re: passing member.member alias to mixin template

2017-09-03 Thread ag0aep6g via Digitalmars-d-learn
On 09/03/2017 08:54 PM, Eric_DD wrote: *** This works: struct Array { void foo() { writeln("foo"); } } mixin template arrayOperations(arrays...) { void foo() { foreach(ref a; arrays) a.foo(); } } class Thing { Array data1; Array data2; mixin arrayOperatio