src/basics.h

changeset 333
07e65a4c6611
parent 313
c24d87f64bed
child 339
4787d05e9c89
equal deleted inserted replaced
332:ae7f7fbb9cda 333:07e65a4c6611
58 { 58 {
59 std::int32_t value; 59 std::int32_t value;
60 constexpr auto operator<=>(const ModelId&) const = default; 60 constexpr auto operator<=>(const ModelId&) const = default;
61 }; 61 };
62 62
63 struct ElementId
64 {
65 std::int32_t value;
66 constexpr auto operator<=>(const ElementId& other) const = default;
67 };
68
69 constexpr auto qHash(ElementId id)
70 {
71 return qHash(id.value);
72 }
73
63 //! \brief count the amount of elements in a basic array 74 //! \brief count the amount of elements in a basic array
64 template<typename T, int N> 75 template<typename T, int N>
65 constexpr int countof(T(&)[N]) 76 constexpr int countof(T(&)[N])
66 { 77 {
67 return N; 78 return N;

mercurial