63 , m_data(std::move(data))
66 explicit Option(
const T& data)
71 template<
class... Args>
81 throw std::runtime_error(
"none option value");
84 return std::move(m_data);
86 const T& value_ref()
const
89 throw std::runtime_error(
"none option value");
96 return std::move(def);
99 return std::move(m_data);
105 throw std::runtime_error(
"none option value");
109 const T& operator*()
const
112 throw std::runtime_error(
"none option value");
120 constexpr
explicit operator bool()
const
122 constexpr
bool has_value()
const
Tag class to help create an empty Option.
An option type inspired by Rust.
Option< T > option_some(T &&value)
Create an Option<T> is some value.