You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was throwing an exception considered? ie. std::logic_error or std::invalid_argument
Perhaps it is left implementation defined, as I can't spot a specific behavior described.
Presently GSL calls std::terminate(), quite a strong response. gsl-lite is the same.
An exception gives the application a chance to handle it (even if that was just gracefully logging). The user wouldn't be impacted by a std::terminate core dump SEGV; which is a bad outcome in a safety critical environment. Even worse in a library, we can't link to anything that might call std::terminate() like this in a safety critical environment; would be an uncontrolled program termination event.
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-nullptr
Was throwing an exception considered? ie. std::logic_error or std::invalid_argument
Perhaps it is left implementation defined, as I can't spot a specific behavior described.
Presently GSL calls std::terminate(), quite a strong response. gsl-lite is the same.
An exception gives the application a chance to handle it (even if that was just gracefully logging). The user wouldn't be impacted by a std::terminate core dump SEGV; which is a bad outcome in a safety critical environment. Even worse in a library, we can't link to anything that might call std::terminate() like this in a safety critical environment; would be an uncontrolled program termination event.
Here is a one file example based on https://github.com/gsl-lite/gsl-lite
https://godbolt.org/z/Wdea6G9EW
This isn't production code, just an example.
The text was updated successfully, but these errors were encountered: