Lines Matching refs:rhs
44 Maybe(const Maybe& rhs);
47 Maybe(const Maybe<U>& rhs); // NOLINT(google-explicit-constructor)
49 Maybe(Maybe&& rhs) noexcept;
52 Maybe(Maybe<U>&& rhs); // NOLINT(google-explicit-constructor)
54 Maybe& operator=(const Maybe& rhs);
57 Maybe& operator=(const Maybe<U>& rhs);
59 Maybe& operator=(Maybe&& rhs) noexcept;
62 Maybe& operator=(Maybe<U>&& rhs);
99 Maybe& copy(const Maybe<U>& rhs);
102 Maybe& move(Maybe<U>&& rhs);
122 Maybe<T>::Maybe(const Maybe& rhs) : nothing_(rhs.nothing_) { in Maybe() argument
123 if (!rhs.nothing_) { in Maybe()
124 new (&storage_) T(reinterpret_cast<const T&>(rhs.storage_)); in Maybe()
130 Maybe<T>::Maybe(const Maybe<U>& rhs) : nothing_(rhs.nothing_) { in Maybe() argument
131 if (!rhs.nothing_) { in Maybe()
132 new (&storage_) T(reinterpret_cast<const U&>(rhs.storage_)); in Maybe()
137 Maybe<T>::Maybe(Maybe&& rhs) noexcept : nothing_(rhs.nothing_) { in Maybe() argument
138 if (!rhs.nothing_) { in Maybe()
139 rhs.nothing_ = true; in Maybe()
142 new (&storage_) T(std::move(reinterpret_cast<T&>(rhs.storage_))); in Maybe()
143 rhs.destroy(); in Maybe()
149 Maybe<T>::Maybe(Maybe<U>&& rhs) : nothing_(rhs.nothing_) { in Maybe() argument
150 if (!rhs.nothing_) { in Maybe()
151 rhs.nothing_ = true; in Maybe()
154 new (&storage_) T(std::move(reinterpret_cast<U&>(rhs.storage_))); in Maybe()
155 rhs.destroy(); in Maybe()
160 inline Maybe<T>& Maybe<T>::operator=(const Maybe& rhs) {
162 return copy(rhs);
167 inline Maybe<T>& Maybe<T>::operator=(const Maybe<U>& rhs) {
168 return copy(rhs);
173 Maybe<T>& Maybe<T>::copy(const Maybe<U>& rhs) { in copy() argument
174 if (nothing_ && rhs.nothing_) { in copy()
177 } else if (!nothing_ && !rhs.nothing_) { in copy()
179 reinterpret_cast<T&>(storage_) = reinterpret_cast<const U&>(rhs.storage_); in copy()
182 nothing_ = rhs.nothing_; in copy()
185 new (&storage_) T(reinterpret_cast<const U&>(rhs.storage_)); in copy()
188 nothing_ = rhs.nothing_; in copy()
195 inline Maybe<T>& Maybe<T>::operator=(Maybe&& rhs) noexcept {
197 return move(std::forward<Maybe<T>>(rhs));
202 inline Maybe<T>& Maybe<T>::operator=(Maybe<U>&& rhs) {
203 return move(std::forward<Maybe<U>>(rhs));
208 Maybe<T>& Maybe<T>::move(Maybe<U>&& rhs) { in move() argument
209 if (nothing_ && rhs.nothing_) { in move()
212 } else if (!nothing_ && !rhs.nothing_) { in move()
214 rhs.nothing_ = true; in move()
216 std::move(reinterpret_cast<U&>(rhs.storage_)); in move()
217 rhs.destroy(); in move()
221 rhs.nothing_ = true; in move()
224 new (&storage_) T(std::move(reinterpret_cast<U&>(rhs.storage_))); in move()
225 rhs.destroy(); in move()