From fd9386222ab102fac57834646b34d4a5014b1588 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Sun, 19 Dec 2021 13:58:03 +0100 Subject: Update wrong info in doc. --- examples/sptr_erase.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/sptr_erase.c b/examples/sptr_erase.c index d08b9072..240b9a58 100644 --- a/examples/sptr_erase.c +++ b/examples/sptr_erase.c @@ -4,12 +4,13 @@ void show_drop(int* x) { printf("drop: %d\n", *x); } #define i_type Arc #define i_val int -#define i_drop show_drop // this "destroy" func shows which elements are destroyed -// csptr/cbox will use pointer address comparison of i_val if no i_cmp func is specified, -// or 'i_opt c_no_cmp' is defined, otherwise i_cmp is used to compare object values. -// See the different results by commenting out the next line. -//#define i_cmp(x, y) (*(x) - *(y)) -#include // Arc: shared pointer to int +#define i_drop show_drop +// csptr/cbox will use pointer address comparison of i_val +// if 'i_opt c_no_cmp' is defined, otherwise i_cmp is used +// to compare object values. See the twodifferences by +// commenting out the next line. +//#define i_opt c_no_cmp +#include // Shared pointer to int #define i_type Vec #define i_val_bind Arc @@ -33,7 +34,7 @@ int main() printf(" %d", *i.ref->get); puts(""); - // erase vec.data[2]; or first matching value depending on compare. + printf("erase vec.data[2]; or first matching value depending on compare.\n"); Vec_iter it; it = Vec_find(&vec, vec.data[2]); if (it.ref != Vec_end(&vec).ref) -- cgit v1.2.3