From eee239dadee4d599c279a7e24972d72c1edcce4d Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 9 Sep 2020 10:09:18 +0200 Subject: More compliance with std:: containers. --- examples/list.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples/list.c') diff --git a/examples/list.c b/examples/list.c index 4eea5620..24dfc82f 100644 --- a/examples/list.c +++ b/examples/list.c @@ -31,8 +31,14 @@ int main() { clist_fx_insert_after(&list, clist_fx_before_begin(&list), 5); // same as push_front() clist_fx_push_back(&list, 500); clist_fx_push_front(&list, 1964); + clist_fx_iter_t it = clist_fx_before_begin(&list); + printf("Full: "); c_foreach (i, clist_fx, list) printf(" %g", i.item->value); + for (int i=0; i<4; ++i) clist_fx_next(&it); + printf("\nSubs: "); + c_foreach (i, clist_fx, it, clist_fx_end(&list)) + printf(" %g", i.item->value); puts(""); clist_fx_destroy(&list); } \ No newline at end of file -- cgit v1.2.3