And I have its implementation (i.e. a derived class) as follows:
1 2 3 4 5 6 7 8 9 10
template <typename A, typename B>
class Derived : public IBase <A, B>
{
protected:
typedef std::set< IBase::<A, B>::MyStruct > MyNewType;
public:
virtualvoid GetInfo(IBase::<A, B>MyStruct& structVar) throw ();
};
I have two problems with this code:
1. In the derived class declaration, it fails in the typedef. I get the following errors:
error: template argument 1 is invalid
error: template argument 2 is invalid
2. In the function declaration of GetInfo, I get an error as well:
IBase::MyStruce is not a type.
protected:
typedef std::set< IBase::<A, B>::MyStruct > MyNewType; // the <A, B> is in the wrong place
public:
virtualvoid GetInfo(IBase::<A, B>MyStruct& structVar) throw ();// the <A, B> is in the wrong place
Oops, my bad.... Okay now I have changed these two statements as
1 2 3 4 5 6
protected:
typedef std::set< IBase<A, B>::MyStruct > MyNewType; // the <A, B> is in the wrong place
public:
virtualvoid GetInfo(IBase<A, B>::MyStruct& structVar) throw ();
Now I get these kinda errors for the first case:
1 2 3
type/value mismatch at argument 1 in template parameter list for `template<class _Tp, class _Alloc> class std::vector
expected a type, got IBase<A, B>::MyStruct
template argument 2 is invalid
And for the second: class IBase<A, B>::MyStruct is not a type