mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-07 01:06: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;
|
constexpr bool has_fn_output_v = has_fn_output<T>::type::value;
|
||||||
|
|
||||||
struct vtable_t {
|
struct vtable_t {
|
||||||
void (*output)(void *, log::level, std::string &&) noexcept;
|
void (*output)(void *, log::level, std::string &&);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class traits {
|
class traits {
|
||||||
template <typename U>
|
template <typename U>
|
||||||
static auto make_fn_output() noexcept
|
static auto make_fn_output() noexcept
|
||||||
-> std::enable_if_t<has_fn_output_v<U>, void (*)(void *, log::level, std::string &&) 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) noexcept {
|
return [](void *p, log::level l, std::string &&s) {
|
||||||
static_cast<U *>(p)->output(l, std::move(s));
|
static_cast<U *>(p)->output(l, std::move(s));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
template <typename U>
|
template <typename U>
|
||||||
static auto make_fn_output() noexcept
|
static auto make_fn_output() noexcept
|
||||||
-> std::enable_if_t<!has_fn_output_v<U>, void (*)(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 &&) noexcept {};
|
return [](void *, log::level, std::string &&) {};
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user