You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a simple context that accepts a memory resource as an input and uses it to allocate the memory for the stack. It also calls cancel() deallocates the memory on destruction.
I just realized today that this object has a bit of a problem. async::context isn't movable and if this inherits it, then its also not going to be movable. But having a version of a context that is movable seems very useful. We can consider this like a smart pointer where you need to use the operator*() and operator->() to access the context. That way, it just holds a pointer to the object and a pointer to the memory resource it used to allocate the memory.
So this type will not inherit async::context but instead will have an API async::context& operator*();.
Activity
kammce commentedon Apr 21, 2026
I just realized today that this object has a bit of a problem. async::context isn't movable and if this inherits it, then its also not going to be movable. But having a version of a context that is movable seems very useful. We can consider this like a smart pointer where you need to use the
operator*()andoperator->()to access the context. That way, it just holds a pointer to the object and a pointer to the memory resource it used to allocate the memory.So this type will not inherit
async::contextbut instead will have an APIasync::context& operator*();.