How to deal with noexcept in Visual Studio

前端 未结 11 1709
一整个雨季
一整个雨季 2021-01-31 07:42

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         


        
11条回答
  •  离开以前
    2021-01-31 08:41

    What I've recently used is following:

    #ifdef _MSC_VER
    #define NOEXCEPT _NOEXCEPT
    #else
    #define NOEXCEPT noexcept
    #endif
    

    and then just use NOEXCEPT everywhere.

提交回复
热议问题