non_trivially_destructible.h 668 B

123456789101112131415161718192021
  1. #ifndef ENTT_COMMON_NON_TRIVIALLY_DESTRUCTIBLE_H
  2. #define ENTT_COMMON_NON_TRIVIALLY_DESTRUCTIBLE_H
  3. #include <compare>
  4. #include <type_traits>
  5. namespace test {
  6. struct non_trivially_destructible final {
  7. ~non_trivially_destructible() {}
  8. [[nodiscard]] constexpr bool operator==(const non_trivially_destructible &) const noexcept = default;
  9. [[nodiscard]] constexpr auto operator<=>(const non_trivially_destructible &) const noexcept = default;
  10. int value{};
  11. };
  12. // ensure non trivially destructible-ness :)
  13. static_assert(!std::is_trivially_destructible_v<test::non_trivially_destructible>, "Not a trivially destructible type");
  14. } // namespace test
  15. #endif