summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-01-17 12:27:21 +0100
committerTyge Løvset <[email protected]>2021-01-17 12:27:21 +0100
commit7acf9651556a5a42023f61dda8cbdd0c406aaaed (patch)
tree48b813fc1853815c8eda5ce746eaee761f8b7efe /docs
parent468b3563369468c8c5a5e17738de783bace34ccc (diff)
downloadSTC-modified-7acf9651556a5a42023f61dda8cbdd0c406aaaed.tar.gz
STC-modified-7acf9651556a5a42023f61dda8cbdd0c406aaaed.zip
Fixed some csmap/csset docs issues.
Diffstat (limited to 'docs')
-rw-r--r--docs/csmap_api.md7
-rw-r--r--docs/csset_api.md2
2 files changed, 5 insertions, 4 deletions
diff --git a/docs/csmap_api.md b/docs/csmap_api.md
index 7dede1be..d4406978 100644
--- a/docs/csmap_api.md
+++ b/docs/csmap_api.md
@@ -179,10 +179,11 @@ Demonstrate csmap with plain-old-data key type Vec3i and int as mapped type: csm
#include <stdio.h>
typedef struct { int x, y, z; } Vec3i;
+
static int Vec3i_compare(const Vec3i* a, const Vec3i* b) {
- if (a->x != b->x) return c_default_compare(a->x, b->x);
- if (a->y != b->y) return c_default_compare(a->y, b->y);
- return c_default_compare(a->z, b->z);
+ if (a->x != b->x) return c_default_compare(&a->x, &b->x);
+ if (a->y != b->y) return c_default_compare(&a->y, &b->y);
+ return c_default_compare(&a->z, &b->z);
}
using_csmap(v3, Vec3i, int, c_default_del, // mapped: empty int destroy func
diff --git a/docs/csset_api.md b/docs/csset_api.md
index b7f9884b..27a744f3 100644
--- a/docs/csset_api.md
+++ b/docs/csset_api.md
@@ -1,4 +1,4 @@
-# STC Container [csset](../stc/cmap.h): Unordered Set
+# STC Container [csset](../stc/csmap.h): Sorted Set
![Set](pics/sset.jpg)
A **csset** is an associative container that contains a sorted set of unique objects of type *Key*. Sorting is done using the key comparison function *keyCompare*. Search, removal, and insertion operations have logarithmic complexity. **csset** is implemented as a AA-tree. See [std::set](https://en.cppreference.com/w/cpp/container/set) for a similar c++ class.