I want to check when I put/pull out a derived CObject from a derived Clist that it is of the correct type:
I thought templating somehow but I can’t find a reference to it?
#include <Arrays\List.mqh>
//+------------------------------------------------------------------+
//| List of trendElements |
//+------------------------------------------------------------------+
class trendHistObj : public CList <template trendHistElement>
{
public:
void trendHistObj()
{
}
~trendHistObj()
{
//remove and delete trendHistElements
Clear();
}
};
//+------------------------------------------------------------------+
//| trendHistElement |
//+------------------------------------------------------------------+
class trendHistElement : public CObject
{
public:
string state;
trendHistElement(string _state)
{
state=_state;
}
~trendHistElement()
{
}
};
//+------------------------------------------------------------------+