diff --git a/include/stdexec/__detail/__any.hpp b/include/stdexec/__detail/__any.hpp index 0c480a846..22e1dee15 100644 --- a/include/stdexec/__detail/__any.hpp +++ b/include/stdexec/__detail/__any.hpp @@ -17,6 +17,7 @@ #include "__concepts.hpp" #include "__config.hpp" +#include "__memory.hpp" #include "__type_traits.hpp" #include "__typeinfo.hpp" #include "__utility.hpp" @@ -28,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -211,7 +213,7 @@ namespace STDEXEC::__any { template STDEXEC_ATTRIBUTE(nodiscard, always_inline) - constexpr auto &operator()(_Ty &&__arg) const noexcept + constexpr auto &&operator()(_Ty &&__arg) const noexcept { return __arg.__value_(static_cast<_Ty &&>(__arg)); } @@ -395,6 +397,11 @@ namespace STDEXEC::__any // needed by MSVC for EBO to work for some reason: constexpr virtual ~__iroot() = default; + constexpr virtual void __delete_() noexcept + { + this->~__iroot(); + } + private: template