In C++, is there a way to detect at runtime whether a function is operating in a noexcept context or not? For example, I have an imaginary function called noexcept_context():
void a() noexcept
{
// f set to true
bool f = noexcept_context() ;
}
void b()
{
// f set to false as long as b() call stack has no noexcept callers
bool f = noexcept_context() ;
}
If it is available in C++ 11 all the better. If not in standard C++, is their a MSVC windows special?