Function overloading bug ?

Weiwen Liu liu@hepvms.physics.yale.edu
Thu Dec 4 06:18:00 GMT 1997


> class A
> {
> public:
>   void f1( unsigned long );
>   void f2( unsigned long, void* callback, int );

This is wrong.
Try this:
    void f2( unsigned long, void (* callback) (), int);

> };
>
> void f3()
> {
> }
>
> void A :: f1( unsigned long )
> {
> 	f2( (unsigned long) 27,  ::f3, 31);
> }
>
> then I get

> hw83.cc: In method `void A::f1(long unsigned int)':
> hw83.cc:15: Error: no matching function for call to `A::f2 (long
> unsigned int, void ()(), int)'
> hw83.cc:6: Error: candidates are: A::f2(long unsigned int, void *, int)




More information about the Gcc-bugs mailing list