This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Arbitrary function as template parameter?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]