Remove optional

This commit is contained in:
Victor Zverovich
2024-01-01 08:14:52 -08:00
parent 0c345dccd2
commit 1705600be3

View File

@ -16,23 +16,6 @@ namespace detail {
inline bool is_whitespace(char c) { return c == ' ' || c == '\n'; }
template <typename T> class optional {
private:
T value_;
bool has_value_ = false;
public:
optional() = default;
optional(T value) : value_(std::move(value)), has_value_(true) {}
explicit operator bool() const { return has_value_; }
auto operator*() const -> const T& {
if (!has_value_) throw std::runtime_error("bad optional access");
return value_;
}
};
struct maybe_contiguous_range {
const char* begin;
const char* end;