This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: koenig lookup in C++
- To: Theodore dot Papadopoulo at sophia dot inria dot fr
- Subject: Re: koenig lookup in C++
- From: Geoff Keating <geoffk at cygnus dot com>
- Date: Wed, 16 Aug 2000 10:32:33 -0700
- CC: gcc at gcc dot gnu dot org, jason at cygnus dot com, mark at codesourcery dot com
- References: <200008161706.e7GH61h10079@mururoa.inria.fr>
> cc: gcc@gcc.gnu.org, jason@cygnus.com, mark@codesourcery.com
> Date: Wed, 16 Aug 2000 19:06:01 +0200
> From: Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
> But here I'm quite sure that it is the test case that is wrong:
>
> Your templated f2 function certainly cannot be associated with any g
> function as it takes 2 parameters whereas all g functions expect as a
> parameter a function with ONLY ONE argument.
Consider this testcase:
namespace N1 {
struct A { };
void g(void (*)(A, A)) {}
}
template <class T>
void f2(N1::A, T) {}
void g(void (*)(int)) {}
int main() {
g(f2); // Works?
}
t.cc: In function `int main ()':
t.cc:12: no matches converting function `f2' to type `void (*) (int)'
t.cc:7: candidates are: template <class T> void f2 (N1::A, T)
Should it work?
--
- Geoffrey Keating <geoffk@cygnus.com>