跳至主要內容

operator==


判断两个IPv4地址是否相等。

bool operator==(addr_t other) const;
bool operator==(const char* other) const;
bool operator==(const std::string& other) const;

示例

nano::Addr addr(0);
addr == (nano::addr_t)0; // true
addr == std::string("0.0.0.0"); // true
addr == "127.0.0.1"; // false