dthuerck / mapmap_cpu

A high-performance general-purpose MRF MAP solver, heavily exploiting SIMD instructions.
BSD 3-Clause "New" or "Revised" License
103 stars 51 forks source link

remove incorrect throw() function specification #39

Closed mitjap closed 1 year ago

mitjap commented 1 year ago

throw() keword in incorrectly used. I can see it is meant to specify which function MAY throw but this specifier does the opposite. It specifies that this function will never throw and if it does it will cause application termination.

A dynamic exception specification whose set of adjusted types is empty (after any packs are expanded) (since C++11) is non-throwing. A function with a non-throwing dynamic exception specification does not allow any exceptions.

If the function throws an exception of the type not listed in its exception specification, the function std::unexpected is called. The default function calls std::terminate, ....

https://en.cppreference.com/w/cpp/language/except_spec https://en.cppreference.com/w/cpp/language/noexcept_spec

dthuerck commented 1 year ago

Thanks - much appreciated!