انضم إلى نوستر
2024-10-18 08:02:55 UTC
in reply to

Josh Simmons on Nostr: personally, I approach this by having an explicit destroy function, which consumes ...

personally, I approach this by having an explicit destroy function, which consumes the value, and then jamming an assert into the drop path which checks whether you're actually inside the explicit destroy function. You still end up with the unfortunate stuff around std::mem::forget, but in those cases I make sure it's merely a leak rather than a safety violation.