Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2001-06-29 17:36:56


On Friday 29 June 2001 05:04, you wrote:
> Douglas Gregor <gregod_at_[hidden]> wrote:
> > Borland C++ seems to have a bug regarding template argument deduction
> > when dealing with function pointers. Consider this:
> >
> > template<typename T> void set(const T& t);
> > int foo(int, int) {};
> > // ...
> > set(&foo);
>
> I don't have enough context to be sure the following is the problem, but in
> this case:
>
> struct x{
> int foo(int,int) {};
> void z(){ set( &foo ); }
> };
>
> with Borland extensions on, Borland C++ treats &foo as a bound "closure__"
> to this->foo. You need to say set( &x::foo ) to get a straight member
> function pointer. I've never been sure how ANSI compliant that was..
>
> De-lurkingly yours,
>
> Ross.

I'm only dealing with free function pointers and static member pointers, so
closures shouldn't be getting in the way.

        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk