json/doc/mkdocs/docs/api/macros/json_noexception.md
Niels Lohmann a6ee8bf9d9
Overwork documentation (#3444)
* 📝 overwork macro documentation

* 📝 address review comments

* 🔧 add style check to Makefile

* 🙈 overwork .gitignore

* 📌 Pygments 2.12.0 is broken

* ✏️ fix links

* 🚸 adjust output to cppcheck

* 📝 add titles to more admonitions

* ✏️ fix typos

* 📝 document future behavior change
2022-04-25 22:40:45 +02:00

906 B

JSON_NOEXCEPTION

#define JSON_NOEXCEPTION

Exceptions can be switched off by defining the symbol JSON_NOEXCEPTION. When defining JSON_NOEXCEPTION, #!cpp try is replaced by #!cpp if (true), #!cpp catch is replaced by #!cpp if (false), and #!cpp throw is replaced by #!cpp std::abort().

The same effect is achieved by setting the compiler flag -fno-exceptions.

Default definition

By default, the macro is not defined.

#undef JSON_NOEXCEPTION

Notes

The explanatory what() string of exceptions is not available for MSVC if exceptions are disabled, see #2824.

See also

Version history

Added in version 2.1.0.