Skip to content

Commit 9a7dba4

Browse files
authored
Fix incorrect template instantiation in inline_task_context (#2012) (#2013)
* Fix incorrect template instantiation in inline_task_context (#2012)
1 parent e06d185 commit 9a7dba4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

include/exec/task.hpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,15 @@ namespace experimental::execution
117117
template <class _ParentPromise>
118118
constexpr explicit __default_task_context_impl(_ParentPromise& __parent) noexcept
119119
{
120-
if constexpr (__with_affinity && __parent_promise_has_start_scheduler<_ParentPromise>())
120+
if constexpr (__with_affinity)
121121
{
122-
// get_start_scheduler is used here to get the parent's "current" scheduler,
123-
// which is the one on which this task has been started (i.e., co_await-ed).
124-
auto __parent_sched = get_start_scheduler(get_env(__parent));
125-
this->__scheduler_ = __parent_sched;
122+
if constexpr (__parent_promise_has_start_scheduler<_ParentPromise>())
123+
{
124+
// get_start_scheduler is used here to get the parent's "current" scheduler,
125+
// which is the one on which this task has been started (i.e., co_await-ed).
126+
auto __parent_sched = get_start_scheduler(get_env(__parent));
127+
this->__scheduler_ = __parent_sched;
128+
}
126129
}
127130
}
128131

0 commit comments

Comments
 (0)