diff options
| author | tylov <[email protected]> | 2023-07-28 11:20:25 +0200 |
|---|---|---|
| committer | tylov <[email protected]> | 2023-07-28 11:20:25 +0200 |
| commit | 078f20f2e378543f078e86f8ad256887378ce92b (patch) | |
| tree | 8d23525993717b1b2bc7130a39f99b60c308281b /misc/examples/smartpointers/arcvec_erase.c | |
| parent | a64d171f0eb76c8f208ffc7d8501baa8222634d3 (diff) | |
| download | STC-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.c | 3 |
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) |
