summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/smartpointers/arcvec_erase.c
diff options
context:
space:
mode:
authortylov <[email protected]>2023-07-28 11:20:25 +0200
committertylov <[email protected]>2023-07-28 11:20:25 +0200
commit078f20f2e378543f078e86f8ad256887378ce92b (patch)
tree8d23525993717b1b2bc7130a39f99b60c308281b /misc/examples/smartpointers/arcvec_erase.c
parenta64d171f0eb76c8f208ffc7d8501baa8222634d3 (diff)
downloadSTC-modified-078f20f2e378543f078e86f8ad256887378ce92b.tar.gz
STC-modified-078f20f2e378543f078e86f8ad256887378ce92b.zip
Improved crand docs and commented out the irrelevant 32-bit variants in the benchmark.
Diffstat (limited to 'misc/examples/smartpointers/arcvec_erase.c')
-rw-r--r--misc/examples/smartpointers/arcvec_erase.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/misc/examples/smartpointers/arcvec_erase.c b/misc/examples/smartpointers/arcvec_erase.c
index ba54c1c7..9d757533 100644
--- a/misc/examples/smartpointers/arcvec_erase.c
+++ b/misc/examples/smartpointers/arcvec_erase.c
@@ -19,7 +19,8 @@ int main(void)
// clone the second 2012 and push it back.
// note: cloning make sure that vec.data[2] has ref count 2.
- Vec_push(&vec, Arc_clone(vec.data[2]));
+ Vec_push(&vec, Arc_clone(vec.data[2])); // => share vec.data[2]
+ Vec_emplace(&vec, *vec.data[2].get); // => deep-copy vec.data[2]
printf("vec before erase :");
c_foreach (i, Vec, vec)