Can I disable exceptions in STL?

后端 未结 3 1067
慢半拍i
慢半拍i 2020-12-08 20:48

I want to disable exceptions in my C++ aplication, compiled under MSVC. I hve switched the option Enable C++ exceptions to NO, but I get warnings telling me to use the optio

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-08 21:52

    You need to use an STL that supports exception deactivation. This is generally a compile-time macro definition.

    Unless I am mistaken, STLPort offers this with _STLP_USE_EXCEPTIONS=0 and _STLP_NO_EXCEPTIONS. I don't know how the programs behave with these settings. ;)

    I think there is some hidden flag in the MS STL as well.

    The EASTL comes out of the box with exceptions disabled:

    http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html

提交回复
热议问题