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]

Arbitrary function as template parameter?


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.

I can do this:

struct foo {};

int i = std::type_description<foo>::is_pod;

But I can't do this:

int foo();

typename std::type_description<foo>::return_type val = foo();


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?



-- Life is short, give up early.


-- Government is not reason, it is not eloquence, it is force; like fire, a troublesome servant and a fearful master. Never for a moment should it be left to irresponsible action.
- George Washington



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