Re:What =delete means
by ginko on Monday October 18, 2021 @11:56AM
(#28906878)
In my company we do so by disallowing constructors to fail. If an object needs to be initialized with the potential of failure you need to call an init() function that returns an error code after construction.
Re:What =delete means
by ahartmetz on Monday October 18, 2021 @12:39PM
(#28907487)
IMO the most important part of RAII is really the other side, "destruction is resource divestment" - and that still works. That is the main purpose of lock guards, refcounting wrappers, file objects and so on.
Yes, that makes RAII basically impossible.