From 4724135f988ef5de088dbf4594451643aaec2bdf Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Tue, 21 Jul 2020 22:33:17 +0200 Subject: 1. Added initializers for containers *_from(). 2. Changed reserve(): size now means how many there actually can be filled with. --- examples/list.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'examples/list.c') diff --git a/examples/list.c b/examples/list.c index 4fa76f81..694ec60b 100644 --- a/examples/list.c +++ b/examples/list.c @@ -5,7 +5,10 @@ declare_CList(ix, uint64_t); int main() { - CList_ix list = clist_init; + CList_ix list = clist_ix_from((uint64_t[]) {10, 20, 30, 40}, 4); + c_foreach (i, clist_ix, list) printf("%zu ", i.item->value); + puts(""); + pcg32_random_t pcg = pcg32_seed(time(NULL), 0); int n; for (int i=0; i<10000000; ++i) // ten million -- cgit v1.2.3