summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-12-19 13:58:03 +0100
committerTyge Løvset <[email protected]>2021-12-19 13:58:03 +0100
commitfd9386222ab102fac57834646b34d4a5014b1588 (patch)
treec9f08d3b62d97cea09c6fae9b78177f18238f89a
parent3fe68afddf494d6ac72f8919b2739e80774cffe8 (diff)
downloadSTC-modified-fd9386222ab102fac57834646b34d4a5014b1588.tar.gz
STC-modified-fd9386222ab102fac57834646b34d4a5014b1588.zip
Update wrong info in doc.
-rw-r--r--examples/sptr_erase.c15
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)