Skip to content

Commit 34d2994

Browse files
committed
test: non_trivially_destructible type
1 parent 011054e commit 34d2994

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#ifndef ENTT_COMMON_NON_TRIVIALLY_DESTRUCTIBLE_H
2+
#define ENTT_COMMON_NON_TRIVIALLY_DESTRUCTIBLE_H
3+
4+
#include <compare>
5+
#include <type_traits>
6+
7+
namespace test {
8+
9+
struct non_trivially_destructible final {
10+
~non_trivially_destructible() {}
11+
[[nodiscard]] constexpr bool operator==(const non_trivially_destructible &) const noexcept = default;
12+
[[nodiscard]] constexpr auto operator<=>(const non_trivially_destructible &) const noexcept = default;
13+
int value{};
14+
};
15+
16+
// ensure non trivially destructible-ness :)
17+
static_assert(!std::is_trivially_destructible_v<test::non_trivially_destructible>, "Not a trivially destructible type");
18+
19+
} // namespace test
20+
21+
#endif

0 commit comments

Comments
 (0)