Commit 6afedf8c authored by Kenton Varda's avatar Kenton Varda

Add AutoCloseFd::operator=

parent 1e94279e
......@@ -240,6 +240,18 @@ public:
KJ_DISALLOW_COPY(AutoCloseFd);
~AutoCloseFd() noexcept(false);
inline AutoCloseFd& operator=(AutoCloseFd&& other) {
AutoCloseFd old(kj::mv(*this));
fd = other.fd;
other.fd = -1;
return *this;
}
inline AutoCloseFd& operator=(decltype(nullptr)) {
AutoCloseFd old(kj::mv(*this));
return *this;
}
inline operator int() { return fd; }
inline int get() { return fd; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment