We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3249935 commit c9551bbCopy full SHA for c9551bb
1 file changed
include/stdexec/__detail/__variant.hpp
@@ -46,6 +46,12 @@ namespace stdexec {
46
struct __monostate { };
47
48
namespace __var {
49
+ template <class _Ty>
50
+ STDEXEC_ATTRIBUTE(host, device, always_inline)
51
+ void __destroy_at(_Ty *ptr) noexcept {
52
+ ptr->~_Ty();
53
+ }
54
+
55
STDEXEC_ATTRIBUTE(host, device)
56
inline auto __mk_index_guard(std::size_t &__index, std::size_t __new) noexcept {
57
__index = __new;
@@ -83,7 +89,7 @@ namespace stdexec {
83
89
STDEXEC_ATTRIBUTE(host, device) void __destroy() noexcept {
84
90
auto __index = std::exchange(__index_, __variant_npos);
85
91
if (__variant_npos != __index) {
86
- ((_Is == __index ? (void) static_cast<_Ts *>(__get_ptr())->~_Ts() : void(0)), ...);
92
+ ((_Is == __index ? __var::__destroy_at(static_cast<_Ts *>(__get_ptr())) : void(0)), ...);
87
93
}
88
94
95
0 commit comments