I want to implement a buffer with a managed variant similar to the following:
struct Buffer { int size; char *ptr; void destruct() {