Arbitrary function as template parameter?
Phil Edwards
phil@codesourcery.com
Fri Sep 26 04:13:00 GMT 2003
On Thu, Sep 25, 2003 at 08:21:20PM -0400, Lally Singh wrote:
> Hi. I'm writing a g++ extension to give more type information via a
> 'special' template type_description<>. Yeah, 'special' templates are
> kludge-esque, but I was able to figure out how to do it this way faster
> than via more __builtins.
See http://www.devphil.com/~pme/reflection.html and search these lists'
archives for mention of the cxx-reflection development branch.
> As parser.c (while very readable) scares me, I'd rather not do any
> changes to the grammar. So, can I declare a template to either take in
> a type or a function, or at least another template that can take an
> arbitrary function as a parameter?
Nope, not without changes to the grammar.
--
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.
- Brian W. Kernighan
More information about the Gcc
mailing list