diff options
author | Oskar Haarklou Veileborg <ohv1020@hotmail.com> | 2023-01-09 20:28:08 +0100 |
---|---|---|
committer | Oskar Haarklou Veileborg <ohv1020@hotmail.com> | 2023-01-09 20:28:08 +0100 |
commit | 8e1383ea6a9561610e00b8c7f401bca1257f9001 (patch) | |
tree | 3ce620c77162717648feb4ae411b6a63acb0f2e3 /README.md | |
parent | Merge pull request #35 from laher/sets-maps-append-multi (diff) | |
download | pds-8e1383ea6a9561610e00b8c7f401bca1257f9001.tar.gz pds-8e1383ea6a9561610e00b8c7f401bca1257f9001.tar.xz |
Ensure immutability of sets (and maps with SetMany)
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -286,8 +286,8 @@ Please see the internal `defaultComparer` for an example, bearing in mind that i ## Set -The `Set` represents a collection of unique values. It uses a `map[T]struct{}`, so it carries over some characteristics from the built-in Go `map` type. -Values neeed to be `comparable`. +The `Set` represents a collection of unique values, and it is implemented as a +wrapper around a `Map[T, struct{}]`. Like Maps, Sets require a `Hasher` to hash keys and check for equality. There are built-in hasher implementations for most primitive types such as `int`, `uint`, and |