Skip to content

Commit c9551bb

Browse files
committed
msvc is a very bad terrible no good compiler
1 parent 3249935 commit c9551bb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

include/stdexec/__detail/__variant.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ namespace stdexec {
4646
struct __monostate { };
4747

4848
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+
4955
STDEXEC_ATTRIBUTE(host, device)
5056
inline auto __mk_index_guard(std::size_t &__index, std::size_t __new) noexcept {
5157
__index = __new;
@@ -83,7 +89,7 @@ namespace stdexec {
8389
STDEXEC_ATTRIBUTE(host, device) void __destroy() noexcept {
8490
auto __index = std::exchange(__index_, __variant_npos);
8591
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)), ...);
8793
}
8894
}
8995

0 commit comments

Comments
 (0)