Delete copy constructor of FDCloser

PiperOrigin-RevId: 243263443
Change-Id: If22d287ce1872ad070454824e8daa36585ab0258
This commit is contained in:
Kevin Hamacher 2019-04-12 07:54:10 -07:00 committed by Copybara-Service
parent 6b5f3645ab
commit ac6a5dfc85

View File

@ -29,6 +29,9 @@ namespace fileops {
class FDCloser { class FDCloser {
public: public:
explicit FDCloser(int fd) : fd_{fd} {} explicit FDCloser(int fd) : fd_{fd} {}
FDCloser(const FDCloser&) = delete;
FDCloser& operator=(const FDCloser&) = delete;
FDCloser(FDCloser&& other) : fd_(other.Release()) {}
~FDCloser(); ~FDCloser();
int get() const { return fd_; } int get() const { return fd_; }