TValue* get_pointer_or_null()
 {
     if (is_set())
     {
         return &(unsafe_get());
     }
     else
     {
         return nullptr;
     }
 }
 TValue &GetOrEmplace(TArgs &&... args)
 {
     EmplaceIfUnset(std::forward<TArgs>(args)...);
     return unsafe_get();
 }
Example #3
0
File: maybe.hpp Project: halybang/w
 Maybe(Maybe<T>&& other) : has_value_(other.has_value_) { if (has_value_) new(unsafe_get()) T(std::move(*other.unsafe_get())); }