Boost logo

Boost :

From: Christopher Currie (christopher_at_[hidden])
Date: 2003-11-20 15:15:56


Peter Dimov wrote:
> Apparently the Sun
> compiler cannot handle pointers to data members well, selecting the general
> overload instead. This would correspond to:
>
> template<class F> void bind(F f);
> template<class R, class T> void f(R T::* pm);
>
> struct X { int i; };
>
> int main() { f(&X::i); }
>
> Unfortunately I don't have access to this compiler so I cannot test my
> theory. ;-)

Did you intend for the two template functions to have different names?
This test compiles without error on my compiler (it doesn't link because
it cannot find the symbol "void f<int,X>(__type_0 __type_1::*)").

>>So even if the compiler is getting type of the
>>expression wrong, shouldn't it be able to find the right template
>>instance?
>
> Yes it should, you have found two bugs in the compiler. ;-)

Lucky me. :-) If only it were only two...

> I don't think that we can do anything about the derived class issue.
> mem_fn_derived_test.cpp will still fail, as it should, as the compiler
> simply cannot handle the case.

Ok, I can accept that, or at least I could if Sun expressed a
willingness to fix their software. Thanks for all your help.

Christopher


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