As an alternative possible solution,

The following allows efficient nested structs in classes:

http://dpaste.dzfl.pl/64025e0a

It is very similar to the idea of voldemort structs except that instead of outer being a function it is a class.

Therefore, it makes sense that one could simply use functors in replace of the functions to get the same behavior(I'm not sure if D supports functors yet as I haven't got that far but I imagine it does).

To be useful, of course, one would have to use static functors so instantiation would not be necessary and direct replacement could be observed only if functor notation is identical to function notation.

Reply via email to