summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-04-08 11:14:57 +0200
committerTyge Løvset <[email protected]>2021-04-08 11:14:57 +0200
commit511663aafac77e04c9f20bdb0ea2142e34474a66 (patch)
treed8f0d6c3a99bc6109c6a81c66cd480fdb850be7c /docs
parent9c5db584ab6bd8ecab600c755ad5443fe4b65d21 (diff)
downloadSTC-modified-511663aafac77e04c9f20bdb0ea2142e34474a66.tar.gz
STC-modified-511663aafac77e04c9f20bdb0ea2142e34474a66.zip
Fix: csmap_X_erase_at() now returns an iter to next element.
Diffstat (limited to 'docs')
-rw-r--r--docs/clist_api.md6
-rw-r--r--docs/csmap_api.md2
2 files changed, 4 insertions, 4 deletions
diff --git a/docs/clist_api.md b/docs/clist_api.md
index cd8c5ed8..4adfdf29 100644
--- a/docs/clist_api.md
+++ b/docs/clist_api.md
@@ -14,10 +14,10 @@ will invalidate other iterators currently refering to these elements and their i
However, an iterator to a succesive element can both be dereferenced and advanced. After advancing (using
*clist_X_next(&it)* or *it = cslist_X_fwd(it, n)*), the iterator is in a valid state. This implies:
-- `clist_X_insert(&L, clist_X_fwd(it,1))` (insert_after) is well formed if element at `it` exists.
-- `clist_X_erase_at(&L, clist_X_fwd(it,1))` (erase_after) is well formed if element at `it` exists and is not last in list.
+- `clist_X_insert(&L, clist_X_fwd(it,1), x)` is identical to *std::forward_list* L.insert_after(it, x)*.
+- `clist_X_erase_at(&L, clist_X_fwd(it,1))` is identical to *std::forward_list* L.erase_after(it)*.
- Iterators returned from *clist_X_insert()* and *clist_X_erase_at()* are always valid or `end`.
-- Elements can be safely removed from a list via multiple iterators if done in back to front order.
+- Elements can be safely removed from a list via multiple iterators if done back to front order.
See the c++ class [std::list](https://en.cppreference.com/w/cpp/container/list) for similar API and
[std::forward_list](https://en.cppreference.com/w/cpp/container/forward_list) for a functional description.
diff --git a/docs/csmap_api.md b/docs/csmap_api.md
index bb023c64..dcde885f 100644
--- a/docs/csmap_api.md
+++ b/docs/csmap_api.md
@@ -65,7 +65,7 @@ csmap_X_result_t csmap_X_emplace_or_assign(csmap_X* self, RawKey rkey, RawMap
void csmap_X_emplace_n(csmap_X* self, const csmap_X_rawvalue_t arr[], size_t size);
size_t csmap_X_erase(csmap_X* self, RawKey rkey);
-csmap_X_iter_t csmap_X_erase_at(csmap_X* self, csmap_X_iter_t pos);
+csmap_X_iter_t csmap_X_erase_at(csmap_X* self, csmap_X_iter_t pos); // returns iter to next element
csmap_X_iter_t csmap_X_begin(const csmap_X* self);
csmap_X_iter_t csmap_X_end(const csmap_X* self);