summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-09-11 22:15:43 +0200
committerTyge Løvset <[email protected]>2021-09-11 22:15:43 +0200
commit658019e1e53ad1ccbca5c623b7199c445eab8b86 (patch)
tree609f3f69e0058984f7b30b06ad2e6cfb9736fb27 /examples
parentaba4aad980ff7f171f53c34915da0755f0ed079c (diff)
downloadSTC-modified-658019e1e53ad1ccbca5c623b7199c445eab8b86.tar.gz
STC-modified-658019e1e53ad1ccbca5c623b7199c445eab8b86.zip
Updated benchmarks to newstyle.
Diffstat (limited to 'examples')
-rw-r--r--examples/csset_erase.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/examples/csset_erase.c b/examples/csset_erase.c
index 774201b2..a8b2c9d0 100644
--- a/examples/csset_erase.c
+++ b/examples/csset_erase.c
@@ -7,24 +7,30 @@ int main()
{
c_forauto (csset_int, set)
{
- c_var (csset_int, set, {30, 20, 80, 40, 60, 90, 10, 70, 50});
- c_foreach (k, csset_int, set) printf(" %d", *k.ref); puts("");
+ c_emplace(csset_int, set, {30, 20, 80, 40, 60, 90, 10, 70, 50});
+ c_foreach (k, csset_int, set)
+ printf(" %d", *k.ref);
+ puts("");
int val = 64;
csset_int_iter_t it;
printf("Show values >= %d:\n", val);
it = csset_int_lower_bound(&set, val);
- c_foreach (k, csset_int, it, csset_int_end(&set)) printf(" %d", *k.ref); puts("");
+ c_foreach (k, csset_int, it, csset_int_end(&set))
+ printf(" %d", *k.ref); puts("");
printf("Erase values >= %d:\n", val);
while (it.ref) it = csset_int_erase_at(&set, it);
- c_foreach (k, csset_int, set) printf(" %d", *k.ref); puts("");
+ c_foreach (k, csset_int, set)
+ printf(" %d", *k.ref);
+ puts("");
val = 40;
printf("Erase values < %d:\n", val);
it = csset_int_lower_bound(&set, val);
csset_int_erase_range(&set, csset_int_begin(&set), it);
- c_foreach (k, csset_int, set) printf(" %d", *k.ref); puts("");
+ c_foreach (k, csset_int, set)
+ printf(" %d", *k.ref);
+ puts("");
}
}
-