3 ms·
Well, given that qsort and bsearch take a function pointer and call it, that function pointer can easily point to a function that throws. So I think this applie
by tsimionescu 2y ago
Well, given that qsort and bsearch take a function pointer and call it, that function pointer can easily point to a function that throws. So I think this applies to all implementations of qsort and bsearch. Especially since there is no way to mark a function pointer as noexcept.
- leni536 2y ago> Especially since there is no way to mark a function pointer as noexcept. There is, noexcept is part of the type since C++17. In fact, I prefer noexcept function pointer parameters for C library wrappers, as I don't expect most libraries written in C to deal with stack unwinding at all.
- tsimionescu 2y agoOops, you're right, I hadn't checked that this had changed in C++ 17.