|
|
@@ -178,11 +178,65 @@ template<typename Res, typename Other>
|
|
|
* @param rhs A valid handle.
|
|
|
* @return False if both handles refer to the same registry, true otherwise.
|
|
|
*/
|
|
|
-template<typename ILhs, typename IRhs>
|
|
|
-[[nodiscard]] bool operator!=(const resource<ILhs> &lhs, const resource<IRhs> &rhs) ENTT_NOEXCEPT {
|
|
|
+template<typename Res, typename Other>
|
|
|
+[[nodiscard]] bool operator!=(const resource<Res> &lhs, const resource<Other> &rhs) ENTT_NOEXCEPT {
|
|
|
return !(lhs == rhs);
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * @brief Compares two handles.
|
|
|
+ * @tparam Res Type of resource managed by the first handle.
|
|
|
+ * @tparam Other Type of resource managed by the second handle.
|
|
|
+ * @param lhs A valid handle.
|
|
|
+ * @param rhs A valid handle.
|
|
|
+ * @return True if the first handle is less than the second, false otherwise.
|
|
|
+ */
|
|
|
+template<typename Res, typename Other>
|
|
|
+[[nodiscard]] bool operator<(const resource<Res> &lhs, const resource<Other> &rhs) ENTT_NOEXCEPT {
|
|
|
+ return (std::addressof(*lhs) < std::addressof(*rhs));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Compares two handles.
|
|
|
+ * @tparam Res Type of resource managed by the first handle.
|
|
|
+ * @tparam Other Type of resource managed by the second handle.
|
|
|
+ * @param lhs A valid handle.
|
|
|
+ * @param rhs A valid handle.
|
|
|
+ * @return True if the first handle is greater than the second, false otherwise.
|
|
|
+ */
|
|
|
+template<typename Res, typename Other>
|
|
|
+[[nodiscard]] bool operator>(const resource<Res> &lhs, const resource<Other> &rhs) ENTT_NOEXCEPT {
|
|
|
+ return (std::addressof(*lhs) > std::addressof(*rhs));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Compares two handles.
|
|
|
+ * @tparam Res Type of resource managed by the first handle.
|
|
|
+ * @tparam Other Type of resource managed by the second handle.
|
|
|
+ * @param lhs A valid handle.
|
|
|
+ * @param rhs A valid handle.
|
|
|
+ * @return True if the first handle is less than or equal to the second, false
|
|
|
+ * otherwise.
|
|
|
+ */
|
|
|
+template<typename Res, typename Other>
|
|
|
+[[nodiscard]] bool operator<=(const resource<Res> &lhs, const resource<Other> &rhs) ENTT_NOEXCEPT {
|
|
|
+ return !(lhs > rhs);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Compares two handles.
|
|
|
+ * @tparam Res Type of resource managed by the first handle.
|
|
|
+ * @tparam Other Type of resource managed by the second handle.
|
|
|
+ * @param lhs A valid handle.
|
|
|
+ * @param rhs A valid handle.
|
|
|
+ * @return True if the first handle is greater than or equal to the second,
|
|
|
+ * false otherwise.
|
|
|
+ */
|
|
|
+template<typename Res, typename Other>
|
|
|
+[[nodiscard]] bool operator>=(const resource<Res> &lhs, const resource<Other> &rhs) ENTT_NOEXCEPT {
|
|
|
+ return !(lhs < rhs);
|
|
|
+}
|
|
|
+
|
|
|
} // namespace entt
|
|
|
|
|
|
#endif
|