diff options
| -rw-r--r-- | examples/sptr_erase.c | 15 |
1 files 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 <stc/csptr.h> // 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 <stc/csptr.h> // 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)
|
