K
Kufa
Hi,
I have nailed down a piece of code that is obviously wrong, but cannot
find what i should i do to make it ansi compliant, neither where in
the reference i should look.
Basically i m trying to get a pointer on a static function of a
template class:
struct A
{
template< class Type1 > struct B
{
template< bool B1, bool B2, bool B3 > static void func( int, int )
{}
};
template< class Type2 > void test();
};
typedef void (*FuncType)(int,int);
template< class Type2 > void A::test()
{
FuncType ptr = &B<Type2>::func<true,true,true>;
ptr(0,0);
}
I know that specializing func outside B wouldnt be correct, but
getting a pointer on it should be allright, right?
Any help is welcome,
Thanks,
/david
I have nailed down a piece of code that is obviously wrong, but cannot
find what i should i do to make it ansi compliant, neither where in
the reference i should look.
Basically i m trying to get a pointer on a static function of a
template class:
struct A
{
template< class Type1 > struct B
{
template< bool B1, bool B2, bool B3 > static void func( int, int )
{}
};
template< class Type2 > void test();
};
typedef void (*FuncType)(int,int);
template< class Type2 > void A::test()
{
FuncType ptr = &B<Type2>::func<true,true,true>;
ptr(0,0);
}
I know that specializing func outside B wouldnt be correct, but
getting a pointer on it should be allright, right?
Any help is welcome,
Thanks,
/david