I want to create a Stack, Queue or List of MqlTick instances.
The following code:
#include <Generic\Queue.mqh>
CQueue<MqlTick> myQueue;
Produces these errors:
'' - objects are passed by reference only ICollection.mqh 14 18
'm_array' - objects are passed by reference only Queue.mqh 140 19
And this:
#include <Generic\Queue.mqh>
CQueue<MqlTick *> longQueue;
Gives:
class type expected, pointer to type 'MqlTick' is not allowed MyTest.mq5
If I do:
#include <Generic\Queue.mqh>
#include <Object.mqh>
CQueue<CObject *> longQueue;
MqlTick currentTick;
longQueue.Add(¤tTick);
The compiler says:
'Add' - no one of the overloads can be applied to the function call MyTest.mq5
could be one of 2 function(s) MyTest.mq5
bool CQueue<CObject*>::Add(CObject*) Queue.mqh 30 22
bool ICollection<CObject*>::Add(CObject*) ICollection.mqh 14 14
Because MqlTick is a struct and not an instance of CObject.