Suggestion: "break template;"

Russell Lewis webmaster at villagersonline.com
Fri Mar 2 07:57:16 PST 2007


Russell Lewis wrote:
> Walter Bright wrote:
>> I suggest looking at using compile time function evaluation for string 
>> parsing instead of using templates.
> 
> I've tried that, but I need to return a struct which represents the 
> parse information.  Thus, I can't use CTFE.

Even if CTFE is upgraded to allow for structs, that still won't solve my 
problem entirely.  Since I'm parsing a string into a parse tree, I need 
to be able to allocate an arbitrary number of nodes and use pointers or 
dynamic arrays in my return value.

Or, as I'm currently doing, I can dynamically generate types by nesting 
types inside other types.

The point is: CTFE needs to be a *lot* more flexible before it works for 
this sort of situation.



More information about the Digitalmars-d mailing list