Sfoglia il codice sorgente

test: shared aggregate type

Michele Caini 2 anni fa
parent
commit
ee1e1a4cd5
1 ha cambiato i file con 25 aggiunte e 0 eliminazioni
  1. 25 0
      test/entt/common/aggregate.h

+ 25 - 0
test/entt/common/aggregate.h

@@ -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