net/SocketDescriptor: allow constructing with "int"

This commit is contained in:
Max Kellermann 2017-08-10 17:37:08 +02:00
parent d2cdaa041c
commit 39f422ded8

View File

@ -42,15 +42,15 @@ class StaticSocketAddress;
*/
class SocketDescriptor : protected FileDescriptor {
protected:
explicit constexpr SocketDescriptor(int _fd)
:FileDescriptor(_fd) {}
explicit constexpr SocketDescriptor(FileDescriptor _fd)
:FileDescriptor(_fd) {}
public:
SocketDescriptor() = default;
explicit constexpr SocketDescriptor(int _fd)
:FileDescriptor(_fd) {}
constexpr bool operator==(SocketDescriptor other) const {
return fd == other.fd;
}