src/basics.h

changeset 309
d862721d19a3
parent 300
3a4b132b8353
child 313
c24d87f64bed
equal deleted inserted replaced
308:daa8770b9d26 309:d862721d19a3
17 */ 17 */
18 18
19 #pragma once 19 #pragma once
20 #include <algorithm> 20 #include <algorithm>
21 #include <cmath> 21 #include <cmath>
22 #include <cinttypes>
22 #include <compare> 23 #include <compare>
23 #include <deque> 24 #include <deque>
24 #include <memory> 25 #include <memory>
25 #include <optional> 26 #include <optional>
26 #include <set> 27 #include <set>
50 using index_t = QVector<int>::size_type; 51 using index_t = QVector<int>::size_type;
51 52
52 Q_DECLARE_METATYPE(glm::vec3) 53 Q_DECLARE_METATYPE(glm::vec3)
53 Q_DECLARE_METATYPE(glm::mat4) 54 Q_DECLARE_METATYPE(glm::mat4)
54 55
56 struct ModelId
57 {
58 std::int32_t value;
59 constexpr auto operator<=>(const ModelId&) const = default;
60 };
61
55 //! \brief count the amount of elements in a basic array 62 //! \brief count the amount of elements in a basic array
56 template<typename T, int N> 63 template<typename T, int N>
57 constexpr int countof(T(&)[N]) 64 constexpr int countof(T(&)[N])
58 { 65 {
59 return N; 66 return N;

mercurial