summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/tanya/container/list.d18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/tanya/container/list.d b/source/tanya/container/list.d
index 4b717ed..4c99906 100644
--- a/source/tanya/container/list.d
+++ b/source/tanya/container/list.d
@@ -3,9 +3,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
- * Linked list.
+ * This module contains singly-linked ($(D_PSYMBOL SList)) and doubly-linked
+ * ($(D_PSYMBOL DList)) lists.
*
- * Copyright: Eugene Wissner 2016-2017.
+ * Copyright: Eugene Wissner 2016-2018.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
@@ -924,7 +925,7 @@ struct SList(T)
}
/**
- * Forward range for the $(D_PSYMBOL DList).
+ * Bidirectional range for the $(D_PSYMBOL DList).
*
* Params:
* L = List type.
@@ -1014,6 +1015,17 @@ struct DRange(L)
/**
* Doubly-linked list.
*
+ * $(D_PSYMBOL DList) can be also used as a queue. Elements can be enqueued
+ * with $(D_PSYMBOL DList.insertBack). To process the queue a `for`-loop comes
+ * in handy:
+ *
+ * ---
+ * for (; !dlist.empty; dlist.removeFront())
+ * {
+ * do_something_with(dlist.front);
+ * }
+ * ---
+ *
* Params:
* T = Content type.
*/