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]

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


> 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

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