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
After internal discussion in the team it was decided that we need to conditional noexcept instead of original noexcept function. Conditional noexcept could be defined in a form:
#ifdef ENABLE_NOEXCEPT // Assuming you have defined this flag during compilation
#defineCONDITIONAL_NOEXCEPTnoexcept
#else
#defineCONDITIONAL_NOEXCEPT
#endif// UsagevoidmyFunction() CONDITIONAL_NOEXCEPT {
// ... function implementation
}
Motivation
Motivation is to take advantage of using noexcept:
Compiler's optimization of noexcept functions
Clarity of developers intent when it is observed that function is defined as noexcept
At the same time noexcept can bring some additional challenges such as runtime termination: if exception is thrown inside noexcept function, stack trace of the crash might be incomplete.
Therefore it makes sense to put noexcept under conditional #define defined during compilation time
Additional context
It makes sense to introduce such define in qtils repo, to take advantage of such define in any project (KAGOME, libp2p, etc)
Are you planning to do it yourself in a pull request ?
No
The text was updated successfully, but these errors were encountered:
Description
After internal discussion in the team it was decided that we need to conditional noexcept instead of original noexcept function. Conditional noexcept could be defined in a form:
Motivation
Motivation is to take advantage of using
noexcept
:noexcept
functionsAt the same time
noexcept
can bring some additional challenges such as runtime termination: if exception is thrown insidenoexcept
function, stack trace of the crash might be incomplete.Therefore it makes sense to put
noexcept
under conditional#define
defined during compilation timeAdditional context
It makes sense to introduce such define in qtils repo, to take advantage of such define in any project (KAGOME, libp2p, etc)
Are you planning to do it yourself in a pull request ?
No
The text was updated successfully, but these errors were encountered: