rapidjson icon indicating copy to clipboard operation
rapidjson copied to clipboard

Throw exception in functions which is specified as noexcept

Open EstherWx opened this issue 2 years ago • 0 comments

When a function is specified noexcept , the compiler does not generate any code to throw exceptions and any uncaught exception will result in a call to std::terminate.

in allocator.h, ~MemoryPoolAllocator() is specified noexcept, but it calls delete, which will throw exception. ~MemoryPoolAllocator() RAPIDJSON_NOEXCEPT { ... RAPIDJSON_DELETE(a); } #define RAPIDJSON_DELETE(x) delete x

And MemoryPoolAllocator& operator=(), too.

Is it intentional to do so? Could we move "RAPIDJSON_NOEXCEPT" here?

EstherWx avatar Dec 22 '23 07:12 EstherWx