Skip to content

Comment on Too dangerous for C++parent

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

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.