Re:The initial proposal for a C++ Ecosystem International St...
by fluoridation on Tuesday October 18, 2022 @06:16PM
(#33254786)
If you really need to do something different at each release point then you can have do_something_special_on_deallocation_failure() notify the error to the release point by a number of different mechanisms.
Yes, all of this makes the code more complicated. The point of these features is not to make the code simpler, but to make it more robust. Rust is also more complicated than C.
Re:The initial proposal for a C++ Ecosystem International St...
by germandiago on Wednesday October 19, 2022 @02:59AM
(#33258622)
Yes, without exceptions is more involved, but way easier than any C alternative doing couple-of-functions mstching for alloc/dealloc.
Also, how to handle a failure to release a resource is context dependent, you can't encode it in the type of the resource unless you create a different type for each call site.