Skip to content

Commit

Permalink
reject failing destroy_at types
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorostsa committed Aug 18, 2023
1 parent b556c02 commit dda8519
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
namespace hpx {

namespace detail {
template <typename T>
#if __cplusplus <= 201703L
// pre c++17 std::destroy_at can be used only on non-array types
template <typename T, HPX_CONCEPT_REQUIRES_(std::is_destructible_v<T> && !std::is_array_v<T>)>
#else
// c++17 std::destroy_at can be used on array types, destructing each element
template <typename T, HPX_CONCEPT_REQUIRES_(std::is_destructible_v<T>)>
#endif
struct destroy_guard
{
T* t;
Expand Down

0 comments on commit dda8519

Please sign in to comment.