-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Hi and thanks for the amazing library!
For handling unexpected values, I would like an unconditional assertion for which a custom assertion handler can decide not to abort, i.e. one that is not annotated with [[noreturn]]
. Something like:
enum_value ToEnum(std::uint8_t byte)
{
switch (value) {
case 0x00: return enum_value::first;
case 0x01: return enum_value::second;
}
UNEXPECTED(byte); // Like PANIC(byte) but can continue if the assertion handler does not abort
return enum_value::unexpected;
}
I want to be able to crash in debug (to make it obvious during testing) but in release, report the value via the assertion handler and continue (to avoid crashing the app for users).
If this is something you'll be interested in as well, I can open a PR for that.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request