Comment on Too dangerous for C++parentComments−jandrewrogers2yInteresting thought experiment. While I haven’t tried it, one half-baked idea that comes to mind is disable both copy and move for the pointer and instantiate the type in C++ thread-local storage. Not that I ever would.−xmcqdpt22yIt is interesting! I experimented with creating a bad borrow checker for Java using annotations fromhttps://checkerframework.org/It supports some level of substructural types using must-call annotations,https://checkerframework.org/manual/#resource-leak-checker
Comments
Interesting thought experiment. While I haven’t tried it, one half-baked idea that comes to mind is disable both copy and move for the pointer and instantiate the type in C++ thread-local storage. Not that I ever would.
It is interesting! I experimented with creating a bad borrow checker for Java using annotations from
https://checkerframework.org/
It supports some level of substructural types using must-call annotations,
https://checkerframework.org/manual/#resource-leak-checker