Lines Matching refs:storage_
128 if (!other.storage_.is_null_)
133 if (!other.storage_.is_null_)
137 constexpr Optional(const T& value) : storage_(value) {}
140 Optional(T&& value) : storage_(std::move(value)) {}
145 : storage_(in_place, std::forward<Args>(args)...) {}
155 if (other.storage_.is_null_) {
165 if (other.storage_.is_null_) {
184 DCHECK(!storage_.is_null_);
191 DCHECK(!storage_.is_null_);
207 constexpr explicit operator bool() const { return !storage_.is_null_; }
209 constexpr bool has_value() const { return !storage_.is_null_; }
214 DCHECK(!storage_.is_null_);
215 return storage_.value_;
220 DCHECK(!storage_.is_null_);
221 return storage_.value_;
227 DCHECK(!storage_.is_null_);
228 return std::move(storage_.value_);
233 DCHECK(!storage_.is_null_);
234 return std::move(storage_.value_);
244 return storage_.is_null_ ? static_cast<T>(std::forward<U>(default_value))
255 return storage_.is_null_ ? static_cast<T>(std::forward<U>(default_value))
260 if (storage_.is_null_ && other.storage_.is_null_)
263 if (storage_.is_null_ != other.storage_.is_null_) {
264 if (storage_.is_null_) {
265 Init(std::move(other.storage_.value_));
268 other.Init(std::move(storage_.value_));
274 DCHECK(!storage_.is_null_ && !other.storage_.is_null_);
291 DCHECK(storage_.is_null_);
292 new (&storage_.value_) T(value);
293 storage_.is_null_ = false;
297 DCHECK(storage_.is_null_);
298 new (&storage_.value_) T(std::move(value));
299 storage_.is_null_ = false;
304 DCHECK(storage_.is_null_);
305 new (&storage_.value_) T(std::forward<Args>(args)...);
306 storage_.is_null_ = false;
310 if (storage_.is_null_)
313 storage_.value_ = value;
317 if (storage_.is_null_)
320 storage_.value_ = std::move(value);
324 if (storage_.is_null_)
326 storage_.value_.~T();
327 storage_.is_null_ = true;
330 internal::OptionalStorage<T> storage_;