From 712197ad6d8db03549d8fe10af5e8231b818e2b2 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 10 Nov 2021 21:55:50 +0300 Subject: [PATCH] Mark some constructors as noexcept. --- tdnet/td/net/HttpFile.h | 2 +- tdutils/td/utils/JsonBuilder.h | 2 +- tdutils/td/utils/Timer.cpp | 2 +- tdutils/td/utils/Timer.h | 2 +- tdutils/td/utils/as.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tdnet/td/net/HttpFile.h b/tdnet/td/net/HttpFile.h index 878186f22..aaec55a77 100644 --- a/tdnet/td/net/HttpFile.h +++ b/tdnet/td/net/HttpFile.h @@ -30,7 +30,7 @@ class HttpFile { HttpFile(const HttpFile &) = delete; HttpFile &operator=(const HttpFile &) = delete; - HttpFile(HttpFile &&other) + HttpFile(HttpFile &&other) noexcept : field_name(std::move(other.field_name)) , name(std::move(other.name)) , content_type(std::move(other.content_type)) diff --git a/tdutils/td/utils/JsonBuilder.h b/tdutils/td/utils/JsonBuilder.h index 23954ad46..47b8a6b80 100644 --- a/tdutils/td/utils/JsonBuilder.h +++ b/tdutils/td/utils/JsonBuilder.h @@ -223,7 +223,7 @@ class JsonScope { CHECK(is_active()); } JsonScope(const JsonScope &other) = delete; - JsonScope(JsonScope &&other) : sb_(other.sb_), jb_(other.jb_), save_scope_(other.save_scope_) { + JsonScope(JsonScope &&other) noexcept : sb_(other.sb_), jb_(other.jb_), save_scope_(other.save_scope_) { other.jb_ = nullptr; } JsonScope &operator=(const JsonScope &) = delete; diff --git a/tdutils/td/utils/Timer.cpp b/tdutils/td/utils/Timer.cpp index 4a256fca6..7e869d1fd 100644 --- a/tdutils/td/utils/Timer.cpp +++ b/tdutils/td/utils/Timer.cpp @@ -50,7 +50,7 @@ PerfWarningTimer::PerfWarningTimer(string name, double max_duration) : name_(std::move(name)), start_at_(Time::now()), max_duration_(max_duration) { } -PerfWarningTimer::PerfWarningTimer(PerfWarningTimer &&other) +PerfWarningTimer::PerfWarningTimer(PerfWarningTimer &&other) noexcept : name_(std::move(other.name_)), start_at_(other.start_at_), max_duration_(other.max_duration_) { other.start_at_ = 0; } diff --git a/tdutils/td/utils/Timer.h b/tdutils/td/utils/Timer.h index 712457031..5c61ee569 100644 --- a/tdutils/td/utils/Timer.h +++ b/tdutils/td/utils/Timer.h @@ -35,7 +35,7 @@ class PerfWarningTimer { explicit PerfWarningTimer(string name, double max_duration = 0.1); PerfWarningTimer(const PerfWarningTimer &) = delete; PerfWarningTimer &operator=(const PerfWarningTimer &) = delete; - PerfWarningTimer(PerfWarningTimer &&other); + PerfWarningTimer(PerfWarningTimer &&other) noexcept; PerfWarningTimer &operator=(PerfWarningTimer &&) = delete; ~PerfWarningTimer(); void reset(); diff --git a/tdutils/td/utils/as.h b/tdutils/td/utils/as.h index b3bd67964..7067a001e 100644 --- a/tdutils/td/utils/as.h +++ b/tdutils/td/utils/as.h @@ -24,7 +24,7 @@ class As { As(const As &new_value) = delete; As &operator=(const As &) = delete; As(As &&) = default; - As &operator=(As &&new_value) && { + As &operator=(As &&new_value) &&noexcept { std::memcpy(ptr_, new_value.ptr_, sizeof(T)); return *this; }