Copies all elements to new array, all elements will be in order they added. This method is thread-safe.
| C# | Visual Basic | Visual C++ |
public T[] ToArray()
Public Function ToArray As T()
public: array<T>^ ToArray()
Returns elements in a new array.