diff --git a/test/entt/common/pointer_stable.h b/test/entt/common/pointer_stable.h new file mode 100644 index 000000000..bb06f5176 --- /dev/null +++ b/test/entt/common/pointer_stable.h @@ -0,0 +1,26 @@ +#ifndef ENTT_COMMON_POINTER_STABLE_HPP +#define ENTT_COMMON_POINTER_STABLE_HPP + +#include + +namespace test { + +struct pointer_stable { + static constexpr auto in_place_delete = true; + int value{}; +}; + +inline bool operator==(const pointer_stable &lhs, const pointer_stable &rhs) { + return lhs.value == rhs.value; +} + +inline bool operator<(const pointer_stable &lhs, const pointer_stable &rhs) { + return lhs.value < rhs.value; +} + +// ensure that we've at least an aggregate type to test here +static_assert(std::is_aggregate_v, "Not an aggregate type"); + +} // namespace test + +#endif