minor changes
This commit is contained in:
parent
e989467ebd
commit
87cf652397
@ -10,8 +10,11 @@
|
||||
namespace uvw {
|
||||
|
||||
|
||||
namespace details {
|
||||
|
||||
|
||||
struct BaseEvent {
|
||||
virtual ~BaseEvent() noexcept = 0;
|
||||
virtual ~BaseEvent() noexcept { }
|
||||
|
||||
static std::size_t next() noexcept {
|
||||
static std::size_t cnt = 0;
|
||||
@ -19,11 +22,12 @@ struct BaseEvent {
|
||||
}
|
||||
};
|
||||
|
||||
BaseEvent::~BaseEvent() noexcept { }
|
||||
|
||||
}
|
||||
|
||||
|
||||
template<typename E>
|
||||
struct Event: BaseEvent {
|
||||
struct Event: details::BaseEvent {
|
||||
static std::size_t type() noexcept {
|
||||
static std::size_t val = BaseEvent::next();
|
||||
return val;
|
||||
|
||||
@ -99,8 +99,8 @@ struct IpTraits<IPv4> {
|
||||
using Type = sockaddr_in;
|
||||
using AddrFuncType = int(*)(const char *, int, sockaddr_in *);
|
||||
using NameFuncType = int(*)(const sockaddr_in *, char *, std::size_t);
|
||||
static const AddrFuncType AddrFunc;
|
||||
static const NameFuncType NameFunc;
|
||||
static constexpr AddrFuncType AddrFunc = &uv_ip4_addr;
|
||||
static constexpr NameFuncType NameFunc = &uv_ip4_name;
|
||||
};
|
||||
|
||||
template<>
|
||||
@ -108,15 +108,10 @@ struct IpTraits<IPv6> {
|
||||
using Type = sockaddr_in6;
|
||||
using AddrFuncType = int(*)(const char *, int, sockaddr_in6 *);
|
||||
using NameFuncType = int(*)(const sockaddr_in6 *, char *, std::size_t);
|
||||
static const AddrFuncType AddrFunc;
|
||||
static const NameFuncType NameFunc;
|
||||
static constexpr AddrFuncType AddrFunc = &uv_ip6_addr;
|
||||
static constexpr NameFuncType NameFunc = &uv_ip6_name;
|
||||
};
|
||||
|
||||
const IpTraits<IPv4>::AddrFuncType IpTraits<IPv4>::AddrFunc = &uv_ip4_addr;
|
||||
const IpTraits<IPv6>::AddrFuncType IpTraits<IPv6>::AddrFunc = &uv_ip6_addr;
|
||||
const IpTraits<IPv4>::NameFuncType IpTraits<IPv4>::NameFunc = &uv_ip4_name;
|
||||
const IpTraits<IPv6>::NameFuncType IpTraits<IPv6>::NameFunc = &uv_ip6_name;
|
||||
|
||||
|
||||
template<typename I>
|
||||
Addr address(const typename details::IpTraits<I>::Type *aptr, int len) noexcept {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user