1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

24 lines
525 B
C++

#pragma once
#include <tuple>
#include <type_traits>
#include <Windows.h>
template <typename T>
std::enable_if_t<std::is_class_v<T> && std::is_trivial_v<T>, bool> operator==(const T& left, const T& right)
{
return toTuple(left) == toTuple(right);
}
template <typename T>
std::enable_if_t<std::is_class_v<T> && std::is_trivial_v<T>, bool> operator<(const T& left, const T& right)
{
return toTuple(left) < toTuple(right);
}
inline auto toTuple(const LUID& luid)
{
return std::make_tuple(luid.LowPart, luid.HighPart);
}