Skip to content

Commit 12dd72a

Browse files
committed
make exec::task's environment public
1 parent 999a11e commit 12dd72a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/exec/task.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ namespace exec {
303303
template <class _Ty, class _Context = default_task_context<_Ty>>
304304
class [[nodiscard]] basic_task {
305305
struct __promise;
306+
using __promise_context_t = typename _Context::template promise_context_t<__promise>;
306307
public:
307308
using __t = basic_task;
308309
using __id = basic_task;
@@ -317,6 +318,10 @@ namespace exec {
317318
__coro_.destroy();
318319
}
319320

321+
auto get_env() const noexcept -> const __promise_context_t& {
322+
return __coro_.promise().get_env();
323+
}
324+
320325
private:
321326
struct __final_awaitable {
322327
static constexpr auto await_ready() noexcept -> bool {
@@ -332,8 +337,6 @@ namespace exec {
332337
}
333338
};
334339

335-
using __promise_context_t = typename _Context::template promise_context_t<__promise>;
336-
337340
struct __promise
338341
: __promise_base<_Ty>
339342
, with_awaitable_senders<__promise> {

0 commit comments

Comments
 (0)