Can't match void parameters for empty parms in ptr-mem-functions.

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Thu Feb 24 02:26:00 GMT 2000


> Attached is a small sample program that demonstrates a problem I'm
> having. I'm running gcc-2.95.2 under ix86/Linux (RedHat 6.1). I'm
> trying to instantiate a template class instance that takes as a
> parameter in its constructor, a pointer to a member function that is
> described by the template parameters. If that member function takes
> a non-void parameter then everything's fine. If it doesn't take a
> parameter, however, the compiler fails to resolve this empty parm as
> a void parm.

I believe your code is illformed, the instantiation of the template
Matcher< Test, bool, void > already fails. 14.8.2, [temp.deduct]/2 says

# ... Type deduction may fail for the following reasons: ...
# Attempting to create a function type in which a parameter has a type
# of void.

If you question this line of reasoning, please discuss it in one of
the public C++ fora first, eg. comp.lang.c++.moderated, or
comp.std.c++.

Regards,
Martin


More information about the Gcc mailing list