Files
mql5-skills/skills/mql5/references/docs/34-standardlibrary/1969-standardlibrary-generic-cqueue.md
T
2026-06-23 21:47:51 +08:00

45 lines
1.2 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CQueue<T>
CQueue<T> is a generic class that implements the ICollection<T> interface.
### Description
The CQueue<T> class is a dynamic collection of T type data, which is organized as a queue that operates on the FIFO (first in, first out) principle.
### Declaration
```
   template<typename T>
   class CQueue : public ICollection<T>
```
### Header
```
   #include <Generic\Queue.mqh>
```
```
Inheritance Hierarchy
  ICollection
      CQueue
```
### Class Methods
| Method | Description |
| --- | --- |
| Add | Adds an element to a queue |
| Enqueue | Adds an element to a queue |
| Count | Returns the number of elements in the queue |
| Contains | Determines whether the queue contains an element with the specified value |
| TrimExcess | Sets the capacity of a queue to the actual number of elements, and thus frees up unused memory |
| CopyTo | Copies all elements of a queue to the specified array starting at the specified index |
| Clear | Removes all elements from a queue |
| Remove | Removes the first occurrence of the specified element from the queue |
| Dequeue | Returns the starting element and removes it from the queue |
| Peek | Returns the starting element without removing it from the queue |