Lines Matching refs:Maybe
35 class Maybe {
40 Maybe();
42 ~Maybe();
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);
67 Maybe(const T& value); // NOLINT(google-explicit-constructor)
72 Maybe(T&& value); // NOLINT(google-explicit-constructor)
96 friend class Maybe;
99 Maybe& copy(const Maybe<U>& rhs);
102 Maybe& move(Maybe<U>&& rhs);
112 Maybe<T>::Maybe() : nothing_(true) {} in Maybe() function
115 Maybe<T>::~Maybe() { in ~Maybe()
122 Maybe<T>::Maybe(const Maybe& rhs) : nothing_(rhs.nothing_) { in Maybe() function
130 Maybe<T>::Maybe(const Maybe<U>& rhs) : nothing_(rhs.nothing_) { in Maybe() function
137 Maybe<T>::Maybe(Maybe&& rhs) noexcept : nothing_(rhs.nothing_) { in Maybe() function
149 Maybe<T>::Maybe(Maybe<U>&& rhs) : nothing_(rhs.nothing_) { in Maybe() function
160 inline Maybe<T>& Maybe<T>::operator=(const Maybe& rhs) {
167 inline Maybe<T>& Maybe<T>::operator=(const Maybe<U>& rhs) {
173 Maybe<T>& Maybe<T>::copy(const Maybe<U>& rhs) { 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()
235 Maybe<T>::Maybe(const T& value) : nothing_(false) { in Maybe() function
240 Maybe<T>::Maybe(T&& value) : nothing_(false) { in Maybe() function
245 Maybe<T>::operator bool() const {
250 T& Maybe<T>::value() { in value()
256 const T& Maybe<T>::value() const { in value()
262 T Maybe<T>::value_or_default(const T& def) const { in value_or_default()
270 void Maybe<T>::destroy() { in destroy()
275 inline Maybe<typename std::remove_reference<T>::type> make_value(T&& value) { in make_value()
276 return Maybe<typename std::remove_reference<T>::type>(std::forward<T>(value)); in make_value()
280 inline Maybe<T> make_nothing() { in make_nothing()
281 return Maybe<T>(); in make_nothing()
288 typename std::enable_if<has_eq_op<T, U>::value, bool>::type operator==(const Maybe<T>& a,
289 const Maybe<U>& b) {
299 typename std::enable_if<has_eq_op<T, U>::value, bool>::type operator==(const Maybe<T>& a,
306 typename std::enable_if<has_eq_op<T, U>::value, bool>::type operator!=(const Maybe<T>& a,
307 const Maybe<U>& b) {
312 typename std::enable_if<has_lt_op<T, U>::value, bool>::type operator<(const Maybe<T>& a,
313 const Maybe<U>& b) {