#ifndef ENTT_COMMON_VALUE_TYPE_H #define ENTT_COMMON_VALUE_TYPE_H #include #include namespace test { template struct pointer_stable_mixin: Type... { static constexpr auto in_place_delete = true; [[nodiscard]] constexpr bool operator==(const pointer_stable_mixin &) const noexcept = default; [[nodiscard]] constexpr auto operator<=>(const pointer_stable_mixin &) const noexcept = default; }; template struct non_trivially_destructible_mixin: Type... { [[nodiscard]] constexpr bool operator==(const non_trivially_destructible_mixin &) const noexcept = default; [[nodiscard]] constexpr auto operator<=>(const non_trivially_destructible_mixin &) const noexcept = default; virtual ~non_trivially_destructible_mixin() = default; }; template struct value_type final: Type... { constexpr value_type() = default; constexpr value_type(int elem): value{elem} {} [[nodiscard]] constexpr bool operator==(const value_type &) const noexcept = default; [[nodiscard]] constexpr auto operator<=>(const value_type &) const noexcept = default; int value{}; }; using pointer_stable = value_type>; using non_trivially_destructible = value_type>; using pointer_stable_non_trivially_destructible = value_type>>; static_assert(std::is_trivially_destructible_v, "Not a trivially destructible type"); static_assert(!std::is_trivially_destructible_v, "Trivially destructible type"); static_assert(!std::is_trivially_destructible_v, "Trivially destructible type"); } // namespace test #endif