class templates and static if

Tyler Jameson Little beatgammit at gmail.com
Mon Feb 27 08:29:25 PST 2012


> Parser!(Type.request) h = new Parser!(Type.request)("Hello world")

Wow, I was so close!  I had tried this:

Parser!Type.request h = new Parser!Type.request("Hello world");

but that didn't work. I didn't think about enclosing it in parens!

I didn't want to do subclassing, because my parser is a state-machine style
parser, so it's in a big switch. Pretty gross, but I would like it to be as
fast as possible. That's why I thought this model would be so cool, because
I could remove conditions from the generated code, and get rid of a lot of
the conditionals.

Thanks so much!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120227/e5fd40e8/attachment.html>


More information about the Digitalmars-d-learn mailing list