From 0c907b38a86b8959c69451c5533bd6a361c96990 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 8 Jul 2018 18:55:12 +0300 Subject: [PATCH] Use different Status::Error in Result. GitOrigin-RevId: 223a42d0bbfa777a821d29d4996e27b1d8fd8fff --- tdutils/td/utils/Status.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tdutils/td/utils/Status.h b/tdutils/td/utils/Status.h index 08edc535..22be4ba1 100644 --- a/tdutils/td/utils/Status.h +++ b/tdutils/td/utils/Status.h @@ -311,7 +311,7 @@ class Status { template class Result { public: - Result() : status_(Status::Error()) { + Result() : status_(Status::Error<1>()) { } template , Result>::value, int> = 0> Result(S &&x) : status_(), value_(std::forward(x)) { @@ -326,7 +326,7 @@ class Result { new (&value_) T(std::move(other.value_)); other.value_.~T(); } - other.status_ = Status::Error(); + other.status_ = Status::Error<2>(); } Result &operator=(Result &&other) { if (status_.is_ok()) { @@ -344,7 +344,7 @@ class Result { other.value_.~T(); } status_ = std::move(other.status_); - other.status_ = Status::Error(); + other.status_ = Status::Error<3>(); return *this; } ~Result() { @@ -375,7 +375,7 @@ class Result { Status move_as_error() TD_WARN_UNUSED_RESULT { CHECK(status_.is_error()); SCOPE_EXIT { - status_ = Status::Error(); + status_ = Status::Error<4>(); }; return std::move(status_); }