From 5d1de359348733896b6d4448a465ce3b7d9d0684 Mon Sep 17 00:00:00 2001 From: Tyge Lovset Date: Mon, 11 Apr 2022 01:22:27 +0200 Subject: Fixed an potential issue with c_eq in template.h and missing usage in clist.h --- examples/list.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/list.c b/examples/list.c index 2d672cf3..fd923719 100644 --- a/examples/list.c +++ b/examples/list.c @@ -10,7 +10,7 @@ int main() { int k; const int n = 2000000; - c_auto (clist_fx, list) + c_auto (clist_fx, list) { stc64_t rng = stc64_init(1234); stc64_uniformf_t dist = stc64_uniformf_init(100.0f, n); @@ -37,6 +37,8 @@ int main() { clist_fx_clear(&list); c_apply(v, clist_fx_push_back(&list, v), int, {10, 20, 30, 40, 30, 50}); + const double* v = clist_fx_get(&list, 30); + printf("found: %f\n", *v); c_foreach (i, clist_fx, list) printf(" %g", *i.ref); puts(""); -- cgit v1.2.3