This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Arbitrary function as template parameter?
- From: Phil Edwards <phil at codesourcery dot com>
- To: lallysingh at mac dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 25 Sep 2003 20:26:14 -0400
- Subject: Re: Arbitrary function as template parameter?
- References: <5A2916B0-EFB7-11D7-95D8-000393123D78@mac.com>
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