In the constructor of one of my classes I have this line :
m_Projects = std::vector<parent_project>(); //m_Projects type is std::vector<parent_project>
m_Current = nullptr; //m_Current type is parent_project*
In a function of this same class I have this line :
m_Projects.push_back(local_project(TITLE, DEMO, FILE)); //local_project class derives from parent_project class.
In a third function of this same class I have these lines :
m_Current = &m_Projects[0];
if (dynamic_cast<local_project*>(m_Current))
SetCurrentProject(dynamic_cast<model::local_univariate::local_univariate_project*>(m_Current));
The dynamic_cast returns a null value, but as I understand the cast would be supposed to work since m_Current is a pointer to the first element of m_Projects, which is a local_project object. I think I may be missing something.