0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-19 00:10:59 +01:00

ircd::net::ipport: Add convenience conversion to ipaddr.

This commit is contained in:
Jason Volk 2019-06-01 14:54:38 -07:00
parent fc9ed2e87e
commit a08d5370f8

View file

@ -55,6 +55,9 @@ struct ircd::net::ipport
explicit operator bool() const; explicit operator bool() const;
bool operator!() const { return !static_cast<bool>(*this); } bool operator!() const { return !static_cast<bool>(*this); }
explicit operator const ipaddr &() const;
explicit operator ipaddr &();
template<class iparg> ipport(iparg&&, const uint16_t &port); template<class iparg> ipport(iparg&&, const uint16_t &port);
template<class iparg> ipport(iparg&&, const string_view &port); template<class iparg> ipport(iparg&&, const string_view &port);
ipport(const string_view &amalgam); ipport(const string_view &amalgam);
@ -111,6 +114,19 @@ ircd::net::ipport::ipport(iparg&& arg,
} }
{} {}
inline ircd::net::ipport::operator
ipaddr &()
{
return this->first;
}
inline ircd::net::ipport::operator
const ipaddr &()
const
{
return this->first;
}
inline ircd::net::ipport::operator inline ircd::net::ipport::operator
bool() bool()
const const