diff --git a/libs/core/type_support/include/hpx/type_support/relocate_at.hpp b/libs/core/type_support/include/hpx/type_support/relocate_at.hpp index 036c4324910a..0af625db38d1 100644 --- a/libs/core/type_support/include/hpx/type_support/relocate_at.hpp +++ b/libs/core/type_support/include/hpx/type_support/relocate_at.hpp @@ -20,7 +20,13 @@ namespace hpx { namespace detail { - template +#if __cplusplus <= 201703L +// pre c++17 std::destroy_at can be used only on non-array types + template && !std::is_array_v)> +#else +// c++17 std::destroy_at can be used on array types, destructing each element + template )> +#endif struct destroy_guard { T* t;