Outer.h :
template<typename T>
class Outer
{
private:
class Inner
{
public:
int m_int;
T * m_template;
Inner(int p_int, const T & p_template);
~Inner();
};
Inner * m_innerList[];
void createInner(int value, const T & template);
Inner * getInner(int p_value) const;
Outer.cpp :
#include "Outer.h"
template<typename T>
void Outer<T>::createInner(int p_value, const T & template) const
{
Inner * newInner = new Inner(p_value, template);
m_innerList.add(newInner);
}
template<typename T>
Outer<T>::Inner * Outer<T>::getInner(int p_value) const
{
for(int i = 0 ; i < nbInner ; i++)
{
if(m_innerList[i]->m_int == p_value)
{
return m_innerList[i];
}
}
}
The code is not full, but my main problem is that it seems that I cannot create a new instance of the "Inner" class inside the "Outer.cpp" nor can I return an instance of the "Inner" class.
I figured I have some problem with the "Outer::" path, or it might be related to the private inside "Outer.h", but I haven't been able to find a working solution yet.
Thanks for your help!