How to correctly use CArrayList<T>

 

I am new to generics and want to understand a syntax. I tried all kinds of version of coding my  classes but failed every time i am trying to instantiate  CArrayList<T>

Can someone demonstrate how to use the CArrayList<L> class so that i can use its add function and other methods?

I am interested in using it with other objects not a primitive types..


//+------------------------------------------------------------------+
//|                                                 GenericClass.mqh |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"


#include <Generic\ArrayList.mqh>
#include <Grid\Dao.mqh>

template<typename T> 
class GenericClass
 {
 

protected:

public:
  
   CArrayList<T>               rates; 
   void add_Dao (T &_t){rates.Add(_t);}
    };
    
    
 void OnTick()
  {
  Dao *dao = new Dao();
  GenericClass g = new GenericClass();
  g.rates.Add(dao);
 
Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • www.mql5.com
Ask questions on technical analysis, discuss trading systems and improve your MQL5 programming skills to develop your own trading strategies. Communicate and share your experience with traders from anywhere in the world, answer questions and help beginners — MQL5.community is developing along with you. Indonesian Member I want to know how...
Files:
 

hi, I want to use CArrayList<L> class  to store Objects same as a generic JAVA ArrayList class. 

have you solved this case?

Reason: