From ee1e1a4cd5764bf5002cfe896679e049c7c04db9 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Thu, 2 Nov 2023 15:04:20 +0100 Subject: [PATCH] test: shared aggregate type --- test/entt/common/aggregate.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/entt/common/aggregate.h diff --git a/test/entt/common/aggregate.h b/test/entt/common/aggregate.h new file mode 100644 index 000000000..25b7e51e5 --- /dev/null +++ b/test/entt/common/aggregate.h @@ -0,0 +1,25 @@ +#ifndef ENTT_COMMON_AGGREGATE_HPP +#define ENTT_COMMON_AGGREGATE_HPP + +#include + +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, "Not an aggregate type"); + +} // namespace test + +#endif