-
|
Hello, I’m a bit curious about the rationale behind the JSON_NOEXCEPTION macro. My understanding is that it doesn’t eliminate exceptions thrown by the standard library, which this library relies on. Why not simply check for -fno-exceptions instead? Am I missing something? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Then you compile the library with for the first occurrence of keywords like |
Beta Was this translation helpful? Give feedback.
-
|
Alright, thanks. I thought those keywords were already replaced in this library when exceptions are disabled with -fno-exceptions or a similar option. I guess that may not always be the case (?) |
Beta Was this translation helpful? Give feedback.
Then you compile the library with
-fno-exceptions, you would get a compiler error likefor the first occurrence of keywords like
try,throw, orcatch. The macroJSON_NOEXCEPTIONreplaces these keywords as described in https://nlohmann.github.io/json/api/macros/json_noexception/.