summaryrefslogtreecommitdiffhomepage
path: root/docs/csmap_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-09-23 07:15:41 +0200
committerTyge Løvset <[email protected]>2022-09-23 07:15:41 +0200
commit34bec4fdf406caff8492d53f0afc80df5d75bba4 (patch)
tree94252139eb34cb37f561ec5a6b9513629b2a81a5 /docs/csmap_api.md
parentd70bcf4d875c14da30a39acfc37d00391cc1e7a9 (diff)
downloadSTC-modified-34bec4fdf406caff8492d53f0afc80df5d75bba4.tar.gz
STC-modified-34bec4fdf406caff8492d53f0afc80df5d75bba4.zip
Deprecated c_forarray, c_forarray_p macros - both replaced by c_forlist, and is consistent with other c_for* macros.
Diffstat (limited to 'docs/csmap_api.md')
-rw-r--r--docs/csmap_api.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/csmap_api.md b/docs/csmap_api.md
index 91abaae3..0be14605 100644
--- a/docs/csmap_api.md
+++ b/docs/csmap_api.md
@@ -113,11 +113,11 @@ int main()
// Create a sorted map of three strings (maps to string)
c_auto (csmap_str, colors) // RAII
{
- c_forarray (csmap_str_raw, v, {
+ c_forlist (i, csmap_str_raw, {
{"RED", "#FF0000"},
{"GREEN", "#00FF00"},
{"BLUE", "#0000FF"}
- }) csmap_str_emplace(&colors, v->first, v->second);
+ }) csmap_str_emplace(&colors, c_pair(i.ref));
// Iterate and print keys and values of sorted map
c_foreach (i, csmap_str, colors) {
@@ -159,8 +159,8 @@ int main()
csmap_id idnames = csmap_id_init();
c_defer (csmap_id_drop(&idnames))
{
- c_forarray (csmap_id_raw, v, { {100, "Red"}, {110, "Blue"} })
- csmap_id_emplace(&idnames, v->first, v->second);
+ c_forlist (i, csmap_id_raw, { {100, "Red"}, {110, "Blue"} })
+ csmap_id_emplace(&idnames, c_pair(i.ref));
// put replaces existing mapped value:
csmap_id_emplace_or_assign(&idnames, 110, "White");