declarations as template parameters

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 30 11:43:30 PDT 2015


On Sunday, 30 August 2015 at 16:31:17 UTC, Daniel N wrote:
> I guess it could be possible to solve using UDA:s instead... 
> maybe I'll try that next, just checking if I'm the only one 
> dreaming about "declarations as template parameters".

What I would love would be being able to pass an anonymous struct 
to a template. Then you can reflect over it to get declarations 
and group them too.

(Actually, I'd love to be able to use anonymous structs anywhere 
a typename is expected. Then you could do:

struct { int a; } foo; // declare a variable named foo as type 
struct { int a; }

but that might break the parser.)


More information about the Digitalmars-d mailing list