From 9f333c8b0fef2897b591c54631af8a7d32e82c03 Mon Sep 17 00:00:00 2001 From: mutouyun Date: Sun, 7 Aug 2022 22:45:14 +0800 Subject: [PATCH] fix: [log] error C2440: 'initializing': cannot convert from '...' to '... noexcept' --- include/libimp/log.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/libimp/log.h b/include/libimp/log.h index 155fe83..34a8190 100644 --- a/include/libimp/log.h +++ b/include/libimp/log.h @@ -54,22 +54,22 @@ template constexpr bool has_fn_output_v = has_fn_output::type::value; struct vtable_t { - void (*output)(void *, log::level, std::string &&) noexcept; + void (*output)(void *, log::level, std::string &&); }; template class traits { template static auto make_fn_output() noexcept - -> std::enable_if_t, void (*)(void *, log::level, std::string &&) noexcept> { - return [](void *p, log::level l, std::string &&s) noexcept { + -> std::enable_if_t, void (*)(void *, log::level, std::string &&)> { + return [](void *p, log::level l, std::string &&s) { static_cast(p)->output(l, std::move(s)); }; } template static auto make_fn_output() noexcept - -> std::enable_if_t, void (*)(void *, log::level, std::string &&) noexcept> { - return [](void *, log::level, std::string &&) noexcept {}; + -> std::enable_if_t, void (*)(void *, log::level, std::string &&)> { + return [](void *, log::level, std::string &&) {}; } public: