net/AddressInfo: add method Cast()
This commit is contained in:
parent
4a2fff019a
commit
7f25ede888
|
@ -55,6 +55,13 @@ public:
|
||||||
constexpr operator SocketAddress() const noexcept {
|
constexpr operator SocketAddress() const noexcept {
|
||||||
return {ai_addr, (SocketAddress::size_type)ai_addrlen};
|
return {ai_addr, (SocketAddress::size_type)ai_addrlen};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cast a #addrinfo reference to an #AddressInfo reference.
|
||||||
|
*/
|
||||||
|
static constexpr const AddressInfo &Cast(const struct addrinfo &ai) noexcept {
|
||||||
|
return static_cast<const AddressInfo &>(ai);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class AddressInfoList {
|
class AddressInfoList {
|
||||||
|
|
Loading…
Reference in New Issue