4 ms·
> However, what I see is the user of cxx/autocxx saying "I am asserting that this API is sound." Right now that's very implicit, and I bet there are users of t
by Dylan16807 6y ago
> However, what I see is the user of cxx/autocxx saying "I am asserting that this API is sound."
Right now that's very implicit, and I bet there are users of the library that don't think they're asserting that. They expect you to follow the documented rules about invariants.
Requiring people to write 'unsafe' at the import site makes that a lot clearer, but if it's mandatory then people are probably going to write it whether the API is sound or not.
I'd be more comfortable if you could either declare an API sound when you import it or write 'unsafe' everywhere you call it.