Generic Class Library - bugs, description, questions, usage and suggestions - page 38

 

Changes in Include\Generic\Queue.mqh.

Most likely, this will not be compiled in MQL4.

 
fxsaber #:

Changes in Include\Generic\Queue.mqh.

Most likely, this will not be compiled in MQL4.

It's not simple changes, it's 2 bugs fixed. And it's not related to build 4772, it's 4 months old.

Forum on trading, automated trading systems and testing trading strategies

Bug in CQueue

Ilyas, 2024.08.26 17:11

Thank you all

Fixed

template<typename T>
int CQueue::CopyTo(T &dst_array[],const int dst_start=0)
  {
//--- resize array
   if((dst_start+m_size)>ArraySize(dst_array))
      if(ArrayResize(dst_array,dst_start+m_size)<0)
         return(0);
//--- copy queue elements from head to tail
   if(m_tail>m_head)
      return(ArrayCopy(dst_array,m_array,dst_start,m_head,m_size));
//--- copy queue elements from head to end
   int num_copied=ArrayCopy(dst_array,m_array,dst_start,m_head,m_array.Size()-m_head);
//--- copy queue elements from beginning to tail
   num_copied+=ArrayCopy(dst_array,m_array,dst_start+num_copied,0,m_tail);
//--- return number of copied elements
   return(num_copied);
  }

 
Alain Verleyen #:

It's not just changes, it's 2 bug fixes. And it's not related to build 4772, it's already 4 months old.

Thanks, I'll keep you posted.