Using lists I use
List<int> list = new List<int>();
list.AddRange(otherList);
How to do this using a Queue?, this Collection does not have a AddRange Method.
Queue<int> q = new Queue<int>();
q.AddRange(otherList); //does not exists
otherList.Foreach(o => q.Enqueue(o));
You can also use this extension method:
public static void AddRange<T>(this Queue<T> queue, IEnumerable<T> enu) {
foreach (T obj in enu)
queue.Enqueue(obj);
}
Queue<int> q = new Queue<int>();
q.AddRange(otherList); //Work!