This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Can't match void parameters for empty parms in ptr-mem-functions.
- To: scherrey at proteus-tech dot com
- Subject: Re: Can't match void parameters for empty parms in ptr-mem-functions.
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Thu, 24 Feb 2000 11:20:50 +0100
- CC: gcc at gcc dot gnu dot org
- References: <38B4EF14.DAE79090@switchco.com>
> 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