Re:Higher RAII and the seven arcane uses of linear types
by jandrewrogers on Tuesday May 14, 2024 @09:18PM
(#40362064)
To some extent, yes. It creates issues for stack allocated types.
[ Parent
| on HN ]
Re:Higher RAII and the seven arcane uses of linear types
by slaymaker1907 on Tuesday May 14, 2024 @09:48PM
(#40362235)
You can sort of work around it by placement new, but it’s still hugely inconvenient in the general case since the thing could have strict alignment requirements.
Oh and not just stack, it also breaks global variables because destructors often get run for those when something gets unloaded or the program stops.
Finally, because C++ gives you tons of control over how assignment works, it’ll probably break being able to use things within other objects unless you give those mark those classes as friend.
Re:Higher RAII and the seven arcane uses of linear types
by IcyWindows on Tuesday May 14, 2024 @09:49PM
(#40362248)
Ah, I forgot that moved-from types in C++ still call the destructor.