Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/w0rp/dstruct
D Data Structures
https://github.com/w0rp/dstruct
Last synced: about 1 month ago
JSON representation
D Data Structures
- Host: GitHub
- URL: https://github.com/w0rp/dstruct
- Owner: w0rp
- License: bsd-2-clause
- Created: 2013-06-25T20:13:08.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2021-03-21T12:06:10.000Z (almost 4 years ago)
- Last Synced: 2024-10-14T05:28:20.839Z (3 months ago)
- Language: D
- Homepage:
- Size: 90.8 KB
- Stars: 17
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dstruct
This library offers a variety of data structures and operations on those
data structures in D.## Quick Start
Check out the code somewhere and you can use it as a DUB package. Everything
in the library is some form of template, so this is a source library and
doesn't need to be built itself.## Data Structures in This Library
* [WeakReference(T)](source/dstruct/weak_reference.d) - An implementation of
weak references.
* [Some(T)](source/dstruct/option.d) - A type wrapping a nullable type which
cannot be null.
* [Option(T)](source/dstruct/option.d) - An Option/Maybe type for safer
null handling.
* [HashMap(K, V)](source/dstruct/map.d) - A garbage collected hashmap type,
just like associative arrays, but usable in more pure and @safe code.
* [HashSet(T)](source/dstruct/set.d) - A garbage collected hashset type.
* [Matrix(T)](source/dstruct/matrix.d) - A garbage collected dynamic
matrix type.
* [Matrix(T, rowCount, columnCount)](source/dstruct/matrix.d) - A static
matrix value type.
* [BasicGraph(T, edgeDirection)](source/dstruct/graph.d) - Directed
and undirected graph types.## Design Philosophy
This library is designed with the following philosophy.
* Everything should be as ```@safe``` and ```pure``` as possible, to
make it easier to write pure functions which are safe.
* Exceptions should only be thrown when not doing so would be unsafe.
* Any function which doesn't throw should be marked ```nothrow```.
* As much as possible, you should be able to reference memory in a safe
manner instead of having to copy it, to cut down on allocation.
* If memory is going to be allocated, it should be done as little as possible,
and when it happens it should *probably* be allocated on
the garbage collected heap.