diff options
author | thegeorg <thegeorg@yandex-team.ru> | 2022-02-10 16:45:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:08 +0300 |
commit | 4e839db24a3bbc9f1c610c43d6faaaa99824dcca (patch) | |
tree | 506dac10f5df94fab310584ee51b24fc5a081c22 /contrib/restricted/abseil-cpp/absl/status/statusor.cc | |
parent | 2d37894b1b037cf24231090eda8589bbb44fb6fc (diff) | |
download | ydb-4e839db24a3bbc9f1c610c43d6faaaa99824dcca.tar.gz |
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/restricted/abseil-cpp/absl/status/statusor.cc')
-rw-r--r-- | contrib/restricted/abseil-cpp/absl/status/statusor.cc | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/contrib/restricted/abseil-cpp/absl/status/statusor.cc b/contrib/restricted/abseil-cpp/absl/status/statusor.cc index 96642b340f..1bb22b9db8 100644 --- a/contrib/restricted/abseil-cpp/absl/status/statusor.cc +++ b/contrib/restricted/abseil-cpp/absl/status/statusor.cc @@ -16,7 +16,7 @@ #include <cstdlib> #include <utility> -#include "absl/base/call_once.h" +#include "absl/base/call_once.h" #include "absl/base/internal/raw_logging.h" #include "absl/status/status.h" #include "absl/strings/str_cat.h" @@ -27,44 +27,44 @@ ABSL_NAMESPACE_BEGIN BadStatusOrAccess::BadStatusOrAccess(absl::Status status) : status_(std::move(status)) {} -BadStatusOrAccess::BadStatusOrAccess(const BadStatusOrAccess& other) - : status_(other.status_) {} - -BadStatusOrAccess& BadStatusOrAccess::operator=( - const BadStatusOrAccess& other) { - // Ensure assignment is correct regardless of whether this->InitWhat() has - // already been called. - other.InitWhat(); - status_ = other.status_; - what_ = other.what_; - return *this; -} - -BadStatusOrAccess& BadStatusOrAccess::operator=(BadStatusOrAccess&& other) { - // Ensure assignment is correct regardless of whether this->InitWhat() has - // already been called. - other.InitWhat(); - status_ = std::move(other.status_); - what_ = std::move(other.what_); - return *this; -} - -BadStatusOrAccess::BadStatusOrAccess(BadStatusOrAccess&& other) - : status_(std::move(other.status_)) {} - +BadStatusOrAccess::BadStatusOrAccess(const BadStatusOrAccess& other) + : status_(other.status_) {} + +BadStatusOrAccess& BadStatusOrAccess::operator=( + const BadStatusOrAccess& other) { + // Ensure assignment is correct regardless of whether this->InitWhat() has + // already been called. + other.InitWhat(); + status_ = other.status_; + what_ = other.what_; + return *this; +} + +BadStatusOrAccess& BadStatusOrAccess::operator=(BadStatusOrAccess&& other) { + // Ensure assignment is correct regardless of whether this->InitWhat() has + // already been called. + other.InitWhat(); + status_ = std::move(other.status_); + what_ = std::move(other.what_); + return *this; +} + +BadStatusOrAccess::BadStatusOrAccess(BadStatusOrAccess&& other) + : status_(std::move(other.status_)) {} + const char* BadStatusOrAccess::what() const noexcept { - InitWhat(); - return what_.c_str(); + InitWhat(); + return what_.c_str(); } const absl::Status& BadStatusOrAccess::status() const { return status_; } -void BadStatusOrAccess::InitWhat() const { - absl::call_once(init_what_, [this] { - what_ = absl::StrCat("Bad StatusOr access: ", status_.ToString()); - }); -} - +void BadStatusOrAccess::InitWhat() const { + absl::call_once(init_what_, [this] { + what_ = absl::StrCat("Bad StatusOr access: ", status_.ToString()); + }); +} + namespace internal_statusor { void Helper::HandleInvalidStatusCtorArg(absl::Status* status) { |