0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

ircd::net: Add remote to hostport conversion.

This commit is contained in:
Jason Volk 2018-01-19 04:54:14 -08:00
parent 02dc5204c9
commit f02c31217b

View file

@ -46,6 +46,7 @@ struct ircd::net::remote
std::string hostname;
explicit operator bool() const;
operator hostport() const;
bool operator!() const { return !static_cast<bool>(*this); }
bool resolved() const;
@ -70,6 +71,13 @@ const
return bool(static_cast<const ipport &>(*this));
}
inline ircd::net::remote::operator
hostport()
const
{
return { hostname, port(*this) };
}
inline ircd::net::remote::operator
bool()
const