RM
if(need_if)
{
if(is_alive) {
// ... code
}
} else {
// ... code
}
Size: a a a
RM
if(need_if)
{
if(is_alive) {
// ... code
}
} else {
// ... code
}
RM
RM
RM
/¯
match need_if {
true if is_alive => false,
false => ...,
_ => ...,
}
G
Т8
RM
/¯
RM
G
G
RM
RM
RM
RM
template<typename BaseType>
bool RegMsgCallback(const NET_SERVER_TYPE type, const uint16_t protoid, BaseType* pBase, void (BaseType::*handleRecv)(const CNetMsg&))
{
NET_MSG_FUNCTOR functor = std::bind(handleRecv, pBase);
return RegMsgCallback(type, protoid, std::move(functor));
}
bool RegMsgCallback(const NET_SERVER_TYPE type, const uint16_t protoid, NET_MSG_FUNCTOR&& cb);
RM