Hi all!
I'm trying to make an inner template specialization. My MSVC 7.0 compiler doesn't really like it, ends with an internal error.
I'd like to ask you if this is a legal declaration.
template <typename T> struct D;
template <typename T> struct R
{
struct A
{
T m;
}...
Hi everyone.
To avoiding virtual inheritance I'm trying to resolve my problem with templates but, now I have a new one:
Class B
{...};
template <class Base> class F1 : public Base
{
void foo() {..}
};
template <class Base> class F2 : public Base
{
void foo() {..}
};
template <class Base>...
Hi!
Here is a simple solution for your problem. This will generate a compilation error if you wan to cast to a wrong type.
For run-time checking use dynamic_cast. (enable RTTI in your compiler in this case!).
Class1
{
};
Class2 : public Class1
{
public:
template<class T> operator T*()
{...