--- a/src/main.h Sun Oct 24 11:33:32 2021 +0300 +++ b/src/main.h Tue Nov 02 15:43:57 2021 +0200 @@ -226,6 +226,44 @@ >{map}; } +template<typename T, typename IdentifierType> +struct TypeValue +{ + T value; + bool operator==(TypeValue<T, IdentifierType> other) const + { + return value == other.value; + } + bool operator!=(TypeValue<T, IdentifierType> other) const + { + return value != other.value; + } + bool operator<(TypeValue<T, IdentifierType> other) const + { + return value < other.value; + } + bool operator>(TypeValue<T, IdentifierType> other) const + { + return value > other.value; + } + bool operator<=(TypeValue<T, IdentifierType> other) const + { + return value <= other.value; + } + bool operator>=(TypeValue<T, IdentifierType> other) const + { + return value >= other.value; + } +}; + +template<typename T, typename R> +int qHash(TypeValue<T, R> value) +{ + return qHash(value.value); +} + +using ModelId = TypeValue<int, struct TypeValueModelId>; + /** * Iterates a @c glm::mat */