summaryrefslogtreecommitdiffhomepage
path: root/docs/cmap_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/cmap_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/cmap_api.md')
-rw-r--r--docs/cmap_api.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/cmap_api.md b/docs/cmap_api.md
index a9676e68..25366792 100644
--- a/docs/cmap_api.md
+++ b/docs/cmap_api.md
@@ -127,11 +127,11 @@ int main()
// Create an unordered_map of three strings (that map to strings)
c_auto (cmap_str, u)
{
- c_forarray (cmap_str_raw, v, {
+ c_forlist (i, cmap_str_raw, {
{"RED", "#FF0000"},
{"GREEN", "#00FF00"},
{"BLUE", "#0000FF"}
- }) cmap_str_emplace(&u, v->first, v->second);
+ }) cmap_str_emplace(&u, c_pair(i.ref));
// Iterate and print keys and values of unordered map
c_foreach (n, cmap_str, u) {
@@ -173,8 +173,8 @@ int main()
c_auto (cmap_id, idnames)
{
- c_forarray (cmap_id_raw, v, { {100, "Red"}, {110, "Blue"} })
- cmap_id_emplace(&idnames, v->first, v->second);
+ c_forlist (i, cmap_id_raw, { {100, "Red"}, {110, "Blue"} })
+ cmap_id_emplace(&idnames, c_pair(i.ref));
// replace existing mapped value:
cmap_id_emplace_or_assign(&idnames, 110, "White");