I\'m trying to create a custom exception that derives from std::exception
and overrides what()
. At first, I wrote it like this:
class U
This check works to see if noexcept
is supported:
// Is noexcept supported?
#if defined(__clang__) && __has_feature(cxx_noexcept) || \
defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 || \
defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 180021114
# define NOEXCEPT noexcept
#else
# define NOEXCEPT
#endif
The above works with Clang, GCC and MSVC.