aggregate.h 542 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. [[nodiscard]] constexpr bool operator==(const aggregate &other) const noexcept {
  8. return value == other.value;
  9. }
  10. [[nodiscard]] constexpr auto operator<=>(const aggregate &other) const noexcept {
  11. return value <=> other.value;
  12. }
  13. };
  14. // ensure aggregate-ness :)
  15. static_assert(std::is_aggregate_v<test::aggregate>, "Not an aggregate type");
  16. } // namespace test
  17. #endif