Queue<T>.CopyTo(T[], Int32) Méthode
Définition
public:
void CopyTo(cli::array <T> ^ array, int arrayIndex);
public void CopyTo (T[] array, int arrayIndex);
member this.CopyTo : 'T[] * int -> unit
Public Sub CopyTo (array As T(), arrayIndex As Integer)
Paramètres
- array
- T[]
Array unidimensionnel qui constitue la destination des éléments copiés à partir de Queue<T>.The one-dimensional Array that is the destination of the elements copied from Queue<T>. Array doit avoir une indexation de base zéro.The Array must have zero-based indexing.
- arrayIndex
- Int32
Index de base zéro dans l'array
à partir duquel la copie commence.The zero-based index in array
at which copying begins.
Exceptions
array
a la valeur null
.array
is null
.
arrayIndex
est inférieur à zéro.arrayIndex
is less than zero.
Le nombre d’éléments dans le Queue<T> source est supérieur à la quantité d’espace disponible entre arrayIndex
et la fin du array
de destination.The number of elements in the source Queue<T> is greater than the available space from arrayIndex
to the end of the destination array
.
Remarques
Les éléments sont copiés Array dans le dans le même ordre que celui dans lequel l’énumérateur itère Queue<T>au sein de.The elements are copied to the Array in the same order in which the enumerator iterates through the Queue<T>.
Cette méthode est une opération On
(), où n
est Count.This method is an O(n
) operation, where n
is Count.