Why is std::free() not declared noexcept?
07:14 24 May 2026

C functions don't throw exceptions - the language doesn't support it.

Also, the free() C function may have undefined behavior for invalid inputs, but - its documentation does not suggest that it can somehow throw a C++ exception under any circusmstances; and the same goes for std::free(). Why, then, is std::free() not declared noexcept?

c++ c exception free noexcept