Re: D game engine -- Any suggestions?

2013-11-20 Thread Henning Pohl
Feel free to take a look at https://github.com/hpohl/ext/. Maybe you can find something useful.

No subclass member loopup in derived class, bug?

2013-03-26 Thread Henning Pohl
struct S { int value() { return 1; } } class Base { S s; alias s this; } class Derived : Base { void func() { int i = value(); } } Fails with main.d(14): Error: undefined identifier value. Explicitly casting this to Base works: void func() {

Recursive expansion

2012-08-17 Thread Henning Pohl
I've ended up with a TypeTuple storing 1230 auto-generated types. Now the compiler claims there is a recursive template expansion. How to stir him from his resolve?

Re: Recursive expansion

2012-08-17 Thread Henning Pohl
On Friday, 17 August 2012 at 22:01:42 UTC, Jonathan M Davis wrote: On Friday, August 17, 2012 23:45:49 Henning Pohl wrote: I've ended up with a TypeTuple storing 1230 auto-generated types. Now the compiler claims there is a recursive template expansion. How to stir him from his resolve? I

Re: Recursive expansion

2012-08-17 Thread Henning Pohl
On Friday, 17 August 2012 at 22:28:12 UTC, bearophile wrote: Henning Pohl: I want to store lots (~615) dynamically loaded function pointers in a class and call them using opDispatch. To provide a type-safe function call, the types of the functions have to be stored somewhere, in a TypeTuple

Re: Specialize mixin templates

2012-08-12 Thread Henning Pohl
On Sunday, 12 August 2012 at 02:32:30 UTC, Timon Gehr wrote: On 08/11/2012 11:42 PM, Henning Pohl wrote: A struct takes a mixin template as argument: struct S(alias Mixin) { mixin Mixin; } How to specialize a mixin template like this one to pass to S? mixin template MixinTemplate(T) { } S

Check whether a type is a instantiated by a template struct

2012-08-11 Thread Henning Pohl
So the struct is defined as: struct S(T) { } template isS(T) { // ... } static assert(isS(S!float)); static assert(!isS(float)); There may be some nasty ways using fullQualifiedName!T and so on but I guess there is a better way, isn't it?

Re: Check whether a type is a instantiated by a template struct

2012-08-11 Thread Henning Pohl
On Saturday, 11 August 2012 at 19:06:22 UTC, Chris Cain wrote: Same idea, but doing it with just one template and using static ifs... struct S(T) {} template isS(T) { static if(is(T _ : S!U, U)) enum isS = true; else enum isS = false; } static assert(isS!(S!float));

Specialize mixin templates

2012-08-11 Thread Henning Pohl
A struct takes a mixin template as argument: struct S(alias Mixin) { mixin Mixin; } How to specialize a mixin template like this one to pass to S? mixin template MixinTemplate(T) { } S(MixinTemplate!float); // Something like this