Skip to content

Commit

Permalink
Adjust namespace of compare operators on vk-handles.
Browse files Browse the repository at this point in the history
  • Loading branch information
asuessenbach committed Dec 9, 2024
1 parent 3e09217 commit 6763fc4
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 90 deletions.
84 changes: 42 additions & 42 deletions VulkanHppGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,58 +232,58 @@ namespace VULKAN_HPP_NAMESPACE
${handleForwardDeclarations}
${uniqueHandles}
${handles}
} // namespace VULKAN_HPP_NAMESPACE

// operators to compare vk::-handles
// 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>
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 );
}
#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 );
}
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==( 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==( 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!=( 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!=( std::nullptr_t, T const & v )
{
return !!v;
}
} // namespace VULKAN_HPP_NAMESPACE
#endif
)";

Expand Down
95 changes: 47 additions & 48 deletions vulkan/vulkan_handles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17706,56 +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 */

} // namespace VULKAN_HPP_NAMESPACE

// 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>
bool 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
// 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>
// bool 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==( 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==( 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!=( 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!=( std::nullptr_t, T const & v )
{
return !!v;
}
} // namespace VULKAN_HPP_NAMESPACE
#endif

0 comments on commit 6763fc4

Please sign in to comment.