I have created a template class(TBase) that defines another class(BaseUDT) within its body.
#pragma once
template<class T>
class TBase
{
public:
class BaseUDT
{
public:
int a;
};
T m_base;
};
Now, i create a class(TDerived) that derives from TBase.
template<class T>
class TDerived : public TBase<T>
{
public:
T m_derived;
BaseUDT m_baseUDT;
};
This code compiles on Visual Studio but when I try compiling it on Xcode on a Mac machine, it throw compile errors. Using TBase::BaseUDT doesn’t work either.
I have been trying to go through the ISO c++ docs but still haven’t found anything relevant so far.
Its name is dependent – declare it like so: