Commit cffc710e authored by Kenton Varda's avatar Kenton Varda

Add const version of OneOf::tryGet().

parent ad87e243
......@@ -118,6 +118,14 @@ public:
return nullptr;
}
}
template <typename T>
Maybe<const T&> tryGet() const {
if (is<T>()) {
return *reinterpret_cast<const T*>(space);
} else {
return nullptr;
}
}
template <uint i>
KJ_NORETURN(void allHandled());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment