Skip to content

Commit

Permalink
Added template keyword in __tuple.hpp for member name disambiguation.
Browse files Browse the repository at this point in the history
The mainline compilers accept the code as-is... for now.
CWG1835 is resolved with the template kw.
There's a recent patch waiting on-deck for Clang to require
template in this position: llvm/llvm-project#92957

Circle requires the token now.
  • Loading branch information
seanbaxter committed Nov 7, 2024
1 parent c1508b1 commit 5679726
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/stdexec/__detail/__tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ namespace stdexec {
struct __tuple<_Idx, _Ts...> : __box<_Ts, _Is>... {
template <class... _Us>
static __tuple __convert_from(__tuple<_Idx, _Us...> &&__tup) {
return __tuple{{static_cast<_Us &&>(__tup.__box<_Us, _Is>::__value)}...};
return __tuple{{static_cast<_Us &&>(__tup.template __box<_Us, _Is>::__value)}...};
}

template <class... _Us>
static __tuple __convert_from(__tuple<_Idx, _Us...> const &__tup) {
return __tuple{{__tup.__box<_Us, _Is>::__value}...};
return __tuple{{__tup.template __box<_Us, _Is>::__value}...};
}

template <class _Fn, class _Self, class... _Us>
Expand All @@ -70,12 +70,12 @@ namespace stdexec {
apply(_Fn &&__fn, _Self &&__self, _Us &&...__us) //
noexcept(noexcept(static_cast<_Fn &&>(__fn)(
static_cast<_Us &&>(__us)...,
static_cast<_Self &&>(__self).__box<_Ts, _Is>::__value...)))
static_cast<_Self &&>(__self).template __box<_Ts, _Is>::__value...)))
-> decltype(static_cast<_Fn &&>(__fn)(
static_cast<_Us &&>(__us)...,
static_cast<_Self &&>(__self).__box<_Ts, _Is>::__value...)) {
static_cast<_Self &&>(__self).template __box<_Ts, _Is>::__value...)) {
return static_cast<_Fn &&>(__fn)(
static_cast<_Us &&>(__us)..., static_cast<_Self &&>(__self).__box<_Ts, _Is>::__value...);
static_cast<_Us &&>(__us)..., static_cast<_Self &&>(__self).template __box<_Ts, _Is>::__value...);
}

template <class _Fn, class _Self, class... _Us>
Expand All @@ -86,7 +86,7 @@ namespace stdexec {
noexcept((__nothrow_callable<_Fn, _Us..., __copy_cvref_t<_Self, _Ts>> && ...)) -> void {
return (
static_cast<_Fn &&>(__fn)(
static_cast<_Us &&>(__us)..., static_cast<_Self &&>(__self).__box<_Ts, _Is>::__value),
static_cast<_Us &&>(__us)..., static_cast<_Self &&>(__self).template __box<_Ts, _Is>::__value),
...);
}
};
Expand Down

0 comments on commit 5679726

Please sign in to comment.