A concept-centered standard library for C++20, enabling safer and more reliable products and a more modern feel for C++ code.; Also home of Subdoc the code-documentation generator.
constexpr Option(const Option& o) noexcept
{
// TODO: This constructed a None value then destroys it and constructs a
// Some value. Optimize.
if (o.t_.state() == Some)
t_.construct_from_none(copy_to_storage(o.t_.val()));
}
The copy/move constructors are not using initializers to set the inner value, they are doing it in the body after initializing to None.
There's a TODO in Option copy ctor about this.
The copy/move constructors are not using initializers to set the inner value, they are doing it in the body after initializing to None.