test: shared aggregate type

This commit is contained in:
Michele Caini
2023-11-02 15:04:20 +01:00
parent a0c85add5b
commit ee1e1a4cd5

View File

@@ -0,0 +1,25 @@
#ifndef ENTT_COMMON_AGGREGATE_HPP
#define ENTT_COMMON_AGGREGATE_HPP
#include <type_traits>
namespace test {
struct aggregate {
int value{};
};
inline bool operator==(const aggregate &lhs, const aggregate &rhs) {
return lhs.value == rhs.value;
}
inline bool operator<(const aggregate &lhs, const aggregate &rhs) {
return lhs.value < rhs.value;
}
// ensure aggregate-ness :)
static_assert(std::is_aggregate_v<test::aggregate>, "Not an aggregate type");
} // namespace test
#endif