Recursive template problem

maelp mael.primet at gmail.com
Wed Jul 30 01:39:42 PDT 2008


I think what he looks for is not the actual result since his array of reals isn't const (not known at compile time), and he simply wants the actual *code* to be generated at compile time, so none of your solution will work. I've had similar problems of recursive template construction, so since there are several posts, maybe we'll have some answers.

My problem was to construct a struct having k (known at compile time) elements named (for instance)
v1 ... vk,

ie. something like

MyStruct!(5) 

=>

struct
{
  int v1, v2, v3, v4, v5 ;
}

someone could help me with this? Or is it possible to do this?

 



More information about the Digitalmars-d mailing list