summaryrefslogtreecommitdiffhomepage
path: root/docs/cbox_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-12-23 23:55:10 +0100
committerTyge Løvset <[email protected]>2022-12-23 23:55:10 +0100
commitd623c6c85071b9af5d607bb5d9aceceaea05220a (patch)
treef20fc3714f86e1553d1103bed6dc8efefcbd9d6b /docs/cbox_api.md
parent5f57d597cd27aef55adbcb3b452973b0c6e33667 (diff)
downloadSTC-modified-d623c6c85071b9af5d607bb5d9aceceaea05220a.tar.gz
STC-modified-d623c6c85071b9af5d607bb5d9aceceaea05220a.zip
Experimental uppercase macros.
Diffstat (limited to 'docs/cbox_api.md')
-rw-r--r--docs/cbox_api.md14
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/cbox_api.md b/docs/cbox_api.md
index b3314433..5f936b1c 100644
--- a/docs/cbox_api.md
+++ b/docs/cbox_api.md
@@ -92,18 +92,18 @@ void int_drop(int* x) {
int main()
{
- c_auto (IVec, vec) // declare and init vec, call drop at scope exit
- c_auto (ISet, set) // similar
+ c_AUTO (IVec, vec) // declare and init vec, call drop at scope exit
+ c_AUTO (ISet, set) // similar
{
- c_forlist (i, int, {2021, 2012, 2022, 2015})
+ c_FORLIST (i, int, {2021, 2012, 2022, 2015})
IVec_emplace(&vec, *i.ref); // same as: IVec_push(&vec, IBox_from(*i.ref));
printf("vec:");
- c_foreach (i, IVec, vec)
+ c_FOREACH (i, IVec, vec)
printf(" %d", *i.ref->get);
// add odd numbers from vec to set
- c_foreach (i, IVec, vec)
+ c_FOREACH (i, IVec, vec)
if (*i.ref->get & 1)
ISet_insert(&set, IBox_clone(*i.ref));
@@ -112,11 +112,11 @@ int main()
IVec_pop(&vec);
printf("\nvec:");
- c_foreach (i, IVec, vec)
+ c_FOREACH (i, IVec, vec)
printf(" %d", *i.ref->get);
printf("\nset:");
- c_foreach (i, ISet, set)
+ c_FOREACH (i, ISet, set)
printf(" %d", *i.ref->get);
}
}