Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-11-20 13:10:34


Christopher Currie wrote:
> The following test case doesn't compile on the Sun compiler:
>
>
> struct B
> {
> int f0() { return 0; }
> };
>
> struct X : public B
> {
> };
>
> template < typename R, typename T >
> void foo ( R ( T::* ) ( ) )
> {
> }
>
> int main()
> {
> foo( &B::f0 );
> foo( &X::f0 );
> }
>
>
> The Sun compiler has no problem with the first foo() call, but fails
> to compile the second. Curiously, if I add this declaration:
>
> template < typename T > void foo( T );
>
> making the function definition a partial specialization, it compiles
> without difficulty.

This affects bind_test, right?

> Is this another expression of the sort of problem that
> BOOST_NO_FUNCTION_TEMPLATE_ORDERING is supposed to workaround? If so,
> should I add this test to the existing config test? If not, do we
> need a new macro and/or config test?

The problem above is not related to function template ordering; your
original example has a single function template, so no ordering is done. The
revised example can be viewed as an ordering issue, even though it's not.

But even if we did have a macro for this case, what could we possibly do
with it?


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