56 return opt_.value().get();
63 throw std::runtime_error(
"Optional reference has no value");
74 explicit operator bool()
const
76 return opt_.has_value();
100 utils::optional<std::reference_wrapper<T>>
opt_;
A simple wrapper class for optional reference types.
T * ptr() const
Returns a pointer to the referenced object or nullptr if no reference is held.
optional_reference(utils::nullopt_t)
optional_reference< T > & operator=(T &new_ref)
utils::optional< std::reference_wrapper< T > > opt_
optional_reference()=default
optional_reference(T &ref)