Re: Strange Mixin issue

2014-03-05 Thread Ali Çehreli
On 03/05/2014 03:10 PM, Frustrated wrote: >> assert(s.Do(1, 2.5) == 3.5); > And this is exactly what I don't what! Sorry, I've completely misunderstood. :) > Do, in my case, is a ctfe used > only at compile time to make it easy to generate code. It's not needed > at runtime and does not be

Re: Strange Mixin issue

2014-03-05 Thread Frustrated
On Wednesday, 5 March 2014 at 23:33:25 UTC, Frustrated wrote: Maybe the problem isn't what I thought it was. I created a test case that works: import std.stdio, std.cstream; mixin template C() { alias A = typeof(this); mixin(B!(A)); } template B(T) { pragma(msg, T); e

Re: Strange Mixin issue

2014-03-05 Thread Frustrated
Maybe the problem isn't what I thought it was. I created a test case that works: import std.stdio, std.cstream; mixin template C() { alias A = typeof(this); mixin(B!(A)); } template B(T) { pragma(msg, T); enum B() { return "string foo() { return `<"~T.stringof~">`; }";

Re: Strange Mixin issue

2014-03-05 Thread Frustrated
On Wednesday, 5 March 2014 at 23:04:06 UTC, Ali Çehreli wrote: On 03/05/2014 02:37 PM, Frustrated wrote: >> import std.typetuple; >> >> template fooImpl(T...) >> { >> static assert(is (T[0] == S));// <-- COOL! >> static assert(is (T[1] == int)); >> static assert(is (T[2] == doubl

Re: Strange Mixin issue

2014-03-05 Thread Ali Çehreli
On 03/05/2014 03:04 PM, Ali Çehreli wrote: template Do(T...) { mixin DoImpl!(TypeTuple!(typeof(this), T)); Actually, TypeTuple is not needed there: mixin DoImpl!(typeof(this), T); Ali

Re: Strange Mixin issue

2014-03-05 Thread Ali Çehreli
On 03/05/2014 02:37 PM, Frustrated wrote: >> import std.typetuple; >> >> template fooImpl(T...) >> { >> static assert(is (T[0] == S));// <-- COOL! >> static assert(is (T[1] == int)); >> static assert(is (T[2] == double)); >> } >> >> template foo(T...) >> { >> alias foo = fooIm

Re: Strange Mixin issue

2014-03-05 Thread Ali Çehreli
On 03/05/2014 01:30 PM, Frustrated wrote: I am trying to remove the unnecessary passing of the type of class to a template but can't seem to get it to work: see The code is the mixin(AbstractToInterface!(WindowsGui, iButton, WindowsButton, iBorder, WindowsBorder)); which I want to not

Re: Strange Mixin issue

2014-03-05 Thread Frustrated
On Wednesday, 5 March 2014 at 22:35:46 UTC, Ali Çehreli wrote: On 03/05/2014 01:30 PM, Frustrated wrote: I am trying to remove the unnecessary passing of the type of class to a template but can't seem to get it to work: see The code is the mixin(AbstractToInterface!(WindowsGui, iButto

Strange Mixin issue

2014-03-05 Thread Frustrated
I am trying to remove the unnecessary passing of the type of class to a template but can't seem to get it to work: see The code is the mixin(AbstractToInterface!(WindowsGui, iButton, WindowsButton, iBorder, WindowsBorder)); which I want to not have to specify WindowsGui. I've t