summaryrefslogtreecommitdiffhomepage
path: root/docs/carc_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/carc_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/carc_api.md')
-rw-r--r--docs/carc_api.md18
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/carc_api.md b/docs/carc_api.md
index 56f8ff2e..d563f2f8 100644
--- a/docs/carc_api.md
+++ b/docs/carc_api.md
@@ -102,20 +102,20 @@ int main()
// POPULATE s1 with shared pointers to Map:
Map *map;
- map = Stack_push(&s1, Arc_from(Map_init()))->get; // push empty map to s1.
- c_forarray (Map_raw, v, { {"Joey", 1990}, {"Mary", 1995}, {"Joanna", 1992}}) {
- Map_emplace(map, v->first, v->second); // populate it.
+ map = Stack_push(&s1, Arc_make(Map_init()))->get; // push empty map to s1.
+ c_forlist (i, Map_raw, {{"Joey", 1990}, {"Mary", 1995}, {"Joanna", 1992}}) {
+ Map_emplace(map, c_pair(i.ref)); // populate it.
}
- map = Stack_push(&s1, Arc_from(Map_init()))->get;
- c_forarray (Map_raw, v, { {"Rosanna", 2001}, {"Brad", 1999}, {"Jack", 1980} }) {
- Map_emplace(map, v->first, v->second);
+ map = Stack_push(&s1, Arc_make(Map_init()))->get;
+ c_forlist (i, Map_raw, {{"Rosanna", 2001}, {"Brad", 1999}, {"Jack", 1980}}) {
+ Map_emplace(map, c_pair(i.ref));
}
// POPULATE s2:
- map = Stack_push(&s2, Arc_from(Map_init()))->get;
- c_forarray (Map_raw, v, { {"Steve", 1979}, {"Rick", 1974}, {"Tracy", 2003} }) {
- Map_emplace(map, v->first, v->second);
+ map = Stack_push(&s2, Arc_make(Map_init()))->get;
+ c_forlist (i, Map_raw, {{"Steve", 1979}, {"Rick", 1974}, {"Tracy", 2003}}) {
+ Map_emplace(map, c_pair(i.ref));
}
// Share two Maps from s1 with s2 by cloning(=sharing) the carcs: