I have a C library that I'm porting to C++ that makes heavy use of manually reference-counted structs. I've considered using shared_ptr
to automatically handle the reference counting, but I also want to maintain the C API. The old signatures look something like this:
Object* object_create(void);
Object* object_retain(Object* o);
void object_release(Object* o);
If I use shared_ptr
, is there any way to effectively expose this manual reference counting in a C API?