Mark some constructors as noexcept.

This commit is contained in:
levlam 2021-11-10 21:55:50 +03:00
parent 6238f0fc89
commit 712197ad6d
5 changed files with 5 additions and 5 deletions

View File

@ -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))

View File

@ -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;

View File

@ -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;
}

View File

@ -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();

View File

@ -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;
}