Merge pull request #54769 from Avogar/fix-timer-descriptor

Don't use default move assignment in TimerDescriptor
This commit is contained in:
Alexey Milovidov 2023-09-24 02:03:08 +03:00 committed by GitHub
commit b8b3c674f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -32,6 +32,12 @@ TimerDescriptor::TimerDescriptor(TimerDescriptor && other) noexcept : timer_fd(o
other.timer_fd = -1;
}
TimerDescriptor & TimerDescriptor::operator=(DB::TimerDescriptor && other) noexcept
{
std::swap(timer_fd, other.timer_fd);
return *this;
}
TimerDescriptor::~TimerDescriptor()
{
/// Do not check for result cause cannot throw exception.

View File

@ -18,7 +18,7 @@ public:
TimerDescriptor(const TimerDescriptor &) = delete;
TimerDescriptor & operator=(const TimerDescriptor &) = delete;
TimerDescriptor(TimerDescriptor && other) noexcept;
TimerDescriptor & operator=(TimerDescriptor &&) = default;
TimerDescriptor & operator=(TimerDescriptor &&) noexcept;
int getDescriptor() const { return timer_fd; }