cpp · cpp/std--bad_optional_access
std--bad_optional_access
std::bad_optional_access
Thrown by std::optional::value() when the optional object does not contain a value. Use optional::has_value() or the dereference operator (*opt) to avoid the throw.