Skip to content
Discussion options

You must be logged in to vote

Hello!

The semantics of copying containers and container handles are actually much the same with both libraries. In both cases, a container should be treated as a struct containing pointers to memory that it is responsible for allocating and freeing. That’s because in Verstable, the handle actually is a struct, and in CC, the handle is a pointer that the library effectively treats like a struct with one (pointer) member.

What this means is that if you duplicate a container handle through assignment, you create two handles, each containing its own pointer to the same data buffer. This will work okay until you mutate the container through one of the handles (e.g. by inserting data). At that…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by duke13137
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants