aggregate.h 522 B

12345678910111213141516171819202122232425
  1. #ifndef ENTT_COMMON_AGGREGATE_H
  2. #define ENTT_COMMON_AGGREGATE_H
  3. #include <type_traits>
  4. namespace test {
  5. struct aggregate {
  6. int value{};
  7. };
  8. [[nodiscard]] inline bool operator==(const aggregate &lhs, const aggregate &rhs) {
  9. return lhs.value == rhs.value;
  10. }
  11. [[nodiscard]] inline bool operator<(const aggregate &lhs, const aggregate &rhs) {
  12. return lhs.value < rhs.value;
  13. }
  14. // ensure aggregate-ness :)
  15. static_assert(std::is_aggregate_v<test::aggregate>, "Not an aggregate type");
  16. } // namespace test
  17. #endif