0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-06 10:38:37 +02:00

ircd::net: Include a remote::resolved() indicator.

This commit is contained in:
Jason Volk 2017-12-28 15:25:57 -07:00
parent 1bc4b46fbd
commit bf9db52428

View file

@ -123,6 +123,7 @@ struct ircd::net::remote
operator bool() const;
bool operator!() const { return !static_cast<bool>(*this); }
bool resolved() const;
remote(std::string hostname, const std::string &port);
remote(std::string hostname, const uint16_t &port);
@ -137,11 +138,18 @@ struct ircd::net::remote
friend std::ostream &operator<<(std::ostream &, const remote &);
};
inline bool
ircd::net::remote::resolved()
const
{
return bool(static_cast<const ipport &>(*this));
}
inline ircd::net::remote::operator
bool()
const
{
return bool(static_cast<const ipport &>(*this)) || !hostname.empty();
return resolved() || !hostname.empty();
}
inline