0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 02:02:38 +01:00

ircd::ctx: Add ADL'ed state() convenience for promise template.

This commit is contained in:
Jason Volk 2018-08-30 19:53:16 -07:00
parent ce245cb116
commit 4b2ff18f6c

View file

@ -85,6 +85,8 @@ struct ircd::ctx::promise<void>
namespace ircd::ctx
{
template<class T> const shared_state<T> &state(const promise<T> &);
template<class T> shared_state<T> &state(promise<T> &);
template<class T> size_t refcount(const shared_state<T> &);
template<class T> void update(shared_state<T> &s);
template<class T> void invalidate(shared_state<T> &);
@ -363,3 +365,17 @@ ircd::ctx::refcount(const shared_state<T> &st)
return ret;
}
template<class T>
ircd::ctx::shared_state<T> &
ircd::ctx::state(promise<T> &promise)
{
return promise.state();
}
template<class T>
const ircd::ctx::shared_state<T> &
ircd::ctx::state(const promise<T> &promise)
{
return promise.state();
}