exception: Fix noexcept qualification
Change-Id: I3a0c48510fa3a51b355e75cbc06a97ba28d4966d
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/stdplus/exception.hpp b/src/stdplus/exception.hpp
index b0c7811..409b0b5 100644
--- a/src/stdplus/exception.hpp
+++ b/src/stdplus/exception.hpp
@@ -28,29 +28,30 @@
template <typename F>
auto ignore(F&& f, const char* file = __builtin_FILE(),
int line = __builtin_LINE(),
- const char* func = __builtin_FUNCTION())
+ const char* func = __builtin_FUNCTION()) noexcept
{
- return [f = std::move(f), file, line, func](auto&&... args) mutable {
- try
- {
- return f(std::forward<decltype(args)>(args)...);
- }
- catch (const std::exception& e)
- {
- fmt::print(stderr, "Ignoring({}:{} {}): {}\n", file, line, func,
- e.what());
- }
- catch (...)
- {
- fmt::print(stderr, "Ignoring({}:{} {}): Invalid Error\n", file,
- line, func);
- }
- using Ret = std::invoke_result_t<decltype(f), decltype(args)...>;
- if constexpr (!std::is_same_v<void, Ret>)
- {
- return Ret();
- }
- };
+ return
+ [f = std::move(f), file, line, func](auto&&... args) mutable noexcept {
+ try
+ {
+ return f(std::forward<decltype(args)>(args)...);
+ }
+ catch (const std::exception& e)
+ {
+ fmt::print(stderr, "Ignoring({}:{} {}): {}\n", file, line, func,
+ e.what());
+ }
+ catch (...)
+ {
+ fmt::print(stderr, "Ignoring({}:{} {}): Invalid Error\n", file,
+ line, func);
+ }
+ using Ret = std::invoke_result_t<decltype(f), decltype(args)...>;
+ if constexpr (!std::is_same_v<void, Ret>)
+ {
+ return Ret();
+ }
+ };
}
} // namespace exception