Boost logo

Boost :

From: Christopher Currie (christopher_at_[hidden])
Date: 2003-11-20 12:47:12


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.

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?

Thanks,
Christopher


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