diff options
Diffstat (limited to 'include/vulkan/vulkan_handles.hpp')
-rw-r--r-- | include/vulkan/vulkan_handles.hpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/include/vulkan/vulkan_handles.hpp b/include/vulkan/vulkan_handles.hpp index 617126a..304e9ed 100644 --- a/include/vulkan/vulkan_handles.hpp +++ b/include/vulkan/vulkan_handles.hpp @@ -17706,5 +17706,55 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NODISCARD typename ResultValueType<uint32_t>::type enumerateInstanceVersion( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ); #endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */ + // operators to compare vk::-handles +#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) + template <typename T, typename std::enable_if<VULKAN_HPP_NAMESPACE::isVulkanHandleType<T>::value, int>::type = 0> + auto operator<=>( T const & lhs, T const & rhs ) + { + return static_cast<typename T::NativeType>( lhs ) <=> static_cast<typename T::NativeType>( rhs ); + } +#else + template <typename T, typename std::enable_if<VULKAN_HPP_NAMESPACE::isVulkanHandleType<T>::value, int>::type = 0> + bool operator==( T const & lhs, T const & rhs ) + { + return static_cast<typename T::NativeType>( lhs ) == static_cast<typename T::NativeType>( rhs ); + } + + template <typename T, typename std::enable_if<VULKAN_HPP_NAMESPACE::isVulkanHandleType<T>::value, int>::type = 0> + bool operator!=( T const & lhs, T const & rhs ) + { + return static_cast<typename T::NativeType>( lhs ) != static_cast<typename T::NativeType>( rhs ); + } + + template <typename T, typename std::enable_if<VULKAN_HPP_NAMESPACE::isVulkanHandleType<T>::value, int>::type = 0> + bool operator<( T const & lhs, T const & rhs ) + { + return static_cast<typename T::NativeType>( lhs ) < static_cast<typename T::NativeType>( rhs ); + } +#endif + + template <typename T, typename std::enable_if<VULKAN_HPP_NAMESPACE::isVulkanHandleType<T>::value, int>::type = 0> + bool operator==( T const & v, std::nullptr_t ) + { + return !v; + } + + template <typename T, typename std::enable_if<VULKAN_HPP_NAMESPACE::isVulkanHandleType<T>::value, int>::type = 0> + bool operator==( std::nullptr_t, T const & v ) + { + return !v; + } + + template <typename T, typename std::enable_if<VULKAN_HPP_NAMESPACE::isVulkanHandleType<T>::value, int>::type = 0> + bool operator!=( T const & v, std::nullptr_t ) + { + return !!v; + } + + template <typename T, typename std::enable_if<VULKAN_HPP_NAMESPACE::isVulkanHandleType<T>::value, int>::type = 0> + bool operator!=( std::nullptr_t, T const & v ) + { + return !!v; + } } // namespace VULKAN_HPP_NAMESPACE #endif |