aboutsummaryrefslogtreecommitdiff
path: root/third_party/abseil-cpp/absl/types/optional.h
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-09 06:02:00 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-09 06:02:00 +0000
commit2159a475510df4ebc23d839f6892e82cb5bad102 (patch)
tree2ce94d7f0804ccb77d1fa9b2a1bca00eecdff1e2 /third_party/abseil-cpp/absl/types/optional.h
parente46ca1bbd03c1dd8ee92b52fe6f867dd2fdba33e (diff)
parent7563023510bf04108a954596ea9393a4c11ac279 (diff)
downloadwebrtc-android13-frc-ipsec-release.tar.gz
Snap for 8558685 from 7563023510bf04108a954596ea9393a4c11ac279 to tm-frc-ipsec-releaset_frc_ips_330443010android13-frc-ipsec-release
Change-Id: Ic50fd695a229b98ae21b783869ae599e62c18c90
Diffstat (limited to 'third_party/abseil-cpp/absl/types/optional.h')
-rw-r--r--third_party/abseil-cpp/absl/types/optional.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/third_party/abseil-cpp/absl/types/optional.h b/third_party/abseil-cpp/absl/types/optional.h
index 2025e29f86..61540cfdb2 100644
--- a/third_party/abseil-cpp/absl/types/optional.h
+++ b/third_party/abseil-cpp/absl/types/optional.h
@@ -136,10 +136,10 @@ class optional : private optional_internal::optional_data<T>,
constexpr optional(nullopt_t) noexcept {} // NOLINT(runtime/explicit)
// Copy constructor, standard semantics
- optional(const optional& src) = default;
+ optional(const optional&) = default;
// Move constructor, standard semantics
- optional(optional&& src) = default;
+ optional(optional&&) = default;
// Constructs a non-empty `optional` direct-initialized value of type `T` from
// the arguments `std::forward<Args>(args)...` within the `optional`.
@@ -412,11 +412,11 @@ class optional : private optional_internal::optional_data<T>,
//
// If you need myOpt->foo in constexpr, use (*myOpt).foo instead.
const T* operator->() const {
- assert(this->engaged_);
+ ABSL_HARDENING_ASSERT(this->engaged_);
return std::addressof(this->data_);
}
T* operator->() {
- assert(this->engaged_);
+ ABSL_HARDENING_ASSERT(this->engaged_);
return std::addressof(this->data_);
}
@@ -425,17 +425,17 @@ class optional : private optional_internal::optional_data<T>,
// Accesses the underlying `T` value of an `optional`. If the `optional` is
// empty, behavior is undefined.
constexpr const T& operator*() const& {
- return ABSL_ASSERT(this->engaged_), reference();
+ return ABSL_HARDENING_ASSERT(this->engaged_), reference();
}
T& operator*() & {
- assert(this->engaged_);
+ ABSL_HARDENING_ASSERT(this->engaged_);
return reference();
}
constexpr const T&& operator*() const && {
- return absl::move(reference());
+ return ABSL_HARDENING_ASSERT(this->engaged_), absl::move(reference());
}
T&& operator*() && {
- assert(this->engaged_);
+ ABSL_HARDENING_ASSERT(this->engaged_);
return std::move(reference());
}
@@ -444,7 +444,7 @@ class optional : private optional_internal::optional_data<T>,
// Returns false if and only if the `optional` is empty.
//
// if (opt) {
- // // do something with opt.value();
+ // // do something with *opt or opt->;
// } else {
// // opt is empty.
// }