J
jburgy
Good morning,
I'm faced with a tricky problem and the C++ gurus I work with couldn't
help. I apologize for not posting actual code, I simply can't for IP
reasons. I have the following inheritance diagram:
class A
{
virtual A *foo( ... ) const;
};
template< class T >
class B : public A
{
virtual A *foo( ... ) const;
};
template< class T >
inline A *B::foo( ... ) const
{
throw( "B's template specializations must override foo!" );
return NULL;
}
I have specializations of B for 8 distinct classes T. I have
explicitly overridden foo for all of them (using a preprocessor macro)
but am getting mixed results. Some cases still end up throwing the
error message shown above (3 when building with MSVC and 5 with g++
although I have no compile errors in either case). Is this something
that's not supported by the standard and I shouldn't expect it to work
reliably? How do I go about debugging it since the problem occurs at
compile-time.
Thanks,
I'm faced with a tricky problem and the C++ gurus I work with couldn't
help. I apologize for not posting actual code, I simply can't for IP
reasons. I have the following inheritance diagram:
class A
{
virtual A *foo( ... ) const;
};
template< class T >
class B : public A
{
virtual A *foo( ... ) const;
};
template< class T >
inline A *B::foo( ... ) const
{
throw( "B's template specializations must override foo!" );
return NULL;
}
I have specializations of B for 8 distinct classes T. I have
explicitly overridden foo for all of them (using a preprocessor macro)
but am getting mixed results. Some cases still end up throwing the
error message shown above (3 when building with MSVC and 5 with g++
although I have no compile errors in either case). Is this something
that's not supported by the standard and I shouldn't expect it to work
reliably? How do I go about debugging it since the problem occurs at
compile-time.
Thanks,