mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
fix: [log] error C2440: 'initializing': cannot convert from '...' to '... noexcept'
This commit is contained in:
parent
ce52a1176c
commit
9f333c8b0f
@ -54,22 +54,22 @@ template <typename T>
|
||||
constexpr bool has_fn_output_v = has_fn_output<T>::type::value;
|
||||
|
||||
struct vtable_t {
|
||||
void (*output)(void *, log::level, std::string &&) noexcept;
|
||||
void (*output)(void *, log::level, std::string &&);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class traits {
|
||||
template <typename U>
|
||||
static auto make_fn_output() noexcept
|
||||
-> std::enable_if_t<has_fn_output_v<U>, void (*)(void *, log::level, std::string &&) noexcept> {
|
||||
return [](void *p, log::level l, std::string &&s) noexcept {
|
||||
-> std::enable_if_t<has_fn_output_v<U>, void (*)(void *, log::level, std::string &&)> {
|
||||
return [](void *p, log::level l, std::string &&s) {
|
||||
static_cast<U *>(p)->output(l, std::move(s));
|
||||
};
|
||||
}
|
||||
template <typename U>
|
||||
static auto make_fn_output() noexcept
|
||||
-> std::enable_if_t<!has_fn_output_v<U>, void (*)(void *, log::level, std::string &&) noexcept> {
|
||||
return [](void *, log::level, std::string &&) noexcept {};
|
||||
-> std::enable_if_t<!has_fn_output_v<U>, void (*)(void *, log::level, std::string &&)> {
|
||||
return [](void *, log::level, std::string &&) {};
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user