I have a third party library which has a lot of c-style raw pointer. Now i am writing a thread in c++ 17. i want to use weak pointer for c style pointers of library. this library can be used by many other thread which modify/delete same pointers. how it can be achieved? is there any design pattern which can help?
In library :
struct table *table = (struct table *) malloc(sizeof(table));
Now in my thread:
auto wp = std::make_weak<struct table* >(table)