1
2
3
4
5
6 using System;
7 using System.Concepts;
8
9 namespace System.Collections
10 {
11 public class Queue<T> where T is Semiregular
12 {
13 public typedef T ValueType;
14
15 public inline nothrow bool IsEmpty() const
16 {
17 return items.IsEmpty();
18 }
19 public inline nothrow long Count() const
20 {
21 return items.Count();
22 }
23 public inline void Put(const ValueType& item)
24 {
25 items.Add(item);
26 }
27 public inline void Put(ValueType&& item)
28 {
29 items.Add(item);
30 }
31 public inline ValueType Get()
32 {
33 return items.RemoveFirst();
34 }
35 public inline nothrow const ValueType& Front() const
36 {
37 return items.Front();
38 }
39 public inline nothrow void Clear()
40 {
41 items.Clear();
42 }
43 public inline nothrow List<ValueType>& Rep()
44 {
45 return items;
46 }
47 private List<ValueType> items;
48 }
49 }