Commit 0b9b191e authored by Dominik Charousset's avatar Dominik Charousset

Add additional unbox overload for convenience

parent 53710909
...@@ -787,6 +787,14 @@ T unbox(caf::optional<T> x) { ...@@ -787,6 +787,14 @@ T unbox(caf::optional<T> x) {
return std::move(*x); return std::move(*x);
} }
/// Unboxes an optional value or fails the test if it doesn't exist.
template <class T>
T unbox(T* x) {
if (x == nullptr)
CAF_FAIL("x == nullptr");
return *x;
}
/// Expands to its argument. /// Expands to its argument.
#define CAF_EXPAND(x) x #define CAF_EXPAND(x) x
......
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