|
|
|
|
|
by ilammy
1777 days ago
|
|
Well but of course! These functions are already implemented with basic exception safety in mind. What if they weren't? This is exactly the same situation as a function that has callback();
which cannot be changed into if Err(error) = callback() {
return error;
}
because that would break some invariants.Changing return type from "void" into some "result" is a mechanical change. |
|
> What if they weren't?
Obviously the language wasn't designed for rebels. The implicit understanding with tools is that you use them the way they're meant to be used. Only in that case do you get to assume you'll reap the benefits they claim to provide. If you insist on deliberately dancing to a different tune, then you get exactly what you asked for. You can't drive against traffic and then complain people run into you.