From 34d2994cf3ca0b14ccf6bfb7304ab29088b28d65 Mon Sep 17 00:00:00 2001 From: skypjack Date: Fri, 20 Feb 2026 10:26:54 +0100 Subject: [PATCH] test: non_trivially_destructible type --- test/common/non_trivially_destructible.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/common/non_trivially_destructible.h diff --git a/test/common/non_trivially_destructible.h b/test/common/non_trivially_destructible.h new file mode 100644 index 000000000..04825c620 --- /dev/null +++ b/test/common/non_trivially_destructible.h @@ -0,0 +1,21 @@ +#ifndef ENTT_COMMON_NON_TRIVIALLY_DESTRUCTIBLE_H +#define ENTT_COMMON_NON_TRIVIALLY_DESTRUCTIBLE_H + +#include +#include + +namespace test { + +struct non_trivially_destructible final { + ~non_trivially_destructible() {} + [[nodiscard]] constexpr bool operator==(const non_trivially_destructible &) const noexcept = default; + [[nodiscard]] constexpr auto operator<=>(const non_trivially_destructible &) const noexcept = default; + int value{}; +}; + +// ensure non trivially destructible-ness :) +static_assert(!std::is_trivially_destructible_v, "Not a trivially destructible type"); + +} // namespace test + +#endif