|
@@ -1,22 +1,33 @@
|
|
|
|
|
|
Namespace std.collections
|
|
|
|
|
|
-#rem monkeydoc @hidden Convenience type alias for Deque\<Int\>.
|
|
|
+#rem monkeydoc Convenience type alias for Deque\<Int\>.
|
|
|
#end
|
|
|
Alias IntDeque:Deque<Int>
|
|
|
|
|
|
-#rem monkeydoc @hidden Convenience type alias for Deque\<Float\>.
|
|
|
+#rem monkeydoc Convenience type alias for Deque\<Float\>.
|
|
|
#end
|
|
|
Alias FloatDeque:Deque<Float>
|
|
|
|
|
|
-#rem monkeydoc @hidden Convenience type alias for Deque\<String\>.
|
|
|
+#rem monkeydoc Convenience type alias for Deque\<String\>.
|
|
|
#end
|
|
|
Alias StringDeque:Deque<String>
|
|
|
|
|
|
-#rem monkeydoc @hidden
|
|
|
+#rem monkeydoc The Deque class.
|
|
|
+
|
|
|
+A deque is a 'double ended queue' (usually pronounced 'deck').
|
|
|
+
|
|
|
+You can efficiently add items to either end of a deque using [[Deque.AddFirst]] and [[Deque.AddLast]], and remove items using [[RemoveFirst]] and [[RemoveLast]].
|
|
|
+
|
|
|
+Deques implement the [[IContainer]] interface so can be used with [[Eachin]] loops.
|
|
|
+
|
|
|
+Note that you should NOT modify a deque while iterating through it with an eachin loop. Doing so while cause a 'concurrent deque modification' runtime error in debug mode. Please see [[IContainer]] for more information.
|
|
|
+
|
|
|
#end
|
|
|
Class Deque<T> Implements IContainer<T>
|
|
|
|
|
|
+ #rem monkeydoc The Deque.Iterator struct.
|
|
|
+ #end
|
|
|
Struct Iterator Implements IIterator<T>
|
|
|
|
|
|
Private
|
|
@@ -135,7 +146,7 @@ Class Deque<T> Implements IContainer<T>
|
|
|
|
|
|
If a deque's length equals its capacity, then the next Add or Insert operation will need to allocate more memory to 'grow' the deque.
|
|
|
|
|
|
- You don't normally need to worry about deque capacity, but it can be useful to use [[Reserve]] to preallocate deque storage if you know in advance
|
|
|
+ You don't normally need to worry about deque capacity, but it can be useful to [[Reserve]] deque storage if you know in advance
|
|
|
how many values a deque is likely to contain, in order to prevent the overhead of excessive memory allocation.
|
|
|
|
|
|
@return The current deque capacity.
|
|
@@ -209,8 +220,7 @@ Class Deque<T> Implements IContainer<T>
|
|
|
|
|
|
If a deque's length equals its capacity, then the next Add, Insert or Push operation will need to allocate more memory to 'grow' the deque.
|
|
|
|
|
|
- You don't normally need to worry about deque capacity, but it can be useful to use [[Reserve]] to preallocate deque storage if you know in advance
|
|
|
- how many values a deque is likely to contain, in order to prevent the overhead of excessive memory allocation.
|
|
|
+ You don't normally need to worry about deque capacity, but it can be useful to use [[Reserve]] to preallocate deque storage if you know in advance how many values a deque is likely to contain, in order to prevent excessive memory allocation.
|
|
|
|
|
|
@param capacity The new capacity.
|
|
|
|