mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2025-09-13 14:02:15 -04:00
Extend check for function pointers on creating compare operators of structs. (#1348)
This commit is contained in:
parent
9748e47228
commit
fac74444fa
@ -9050,20 +9050,22 @@ std::string VulkanHppGenerator::generateStructCompareOperators( std::pair<std::s
|
|||||||
std::string compareBody, spaceshipOperator, spaceshipOperatorIf, spaceshipOperatorElse, spaceshipOperatorEndif;
|
std::string compareBody, spaceshipOperator, spaceshipOperatorIf, spaceshipOperatorElse, spaceshipOperatorEndif;
|
||||||
if ( nonDefaultCompare )
|
if ( nonDefaultCompare )
|
||||||
{
|
{
|
||||||
assert( !containsFuncPointer( structData.first ) );
|
|
||||||
compareBody = " return " + compareMembers + ";";
|
compareBody = " return " + compareMembers + ";";
|
||||||
|
|
||||||
static const std::string spaceshipOperatorTemplate =
|
if ( !containsFuncPointer( structData.first ) )
|
||||||
R"( ${ordering} operator<=>( ${name} const & rhs ) const VULKAN_HPP_NOEXCEPT
|
{
|
||||||
|
static const std::string spaceshipOperatorTemplate =
|
||||||
|
R"( ${ordering} operator<=>( ${name} const & rhs ) const VULKAN_HPP_NOEXCEPT
|
||||||
{
|
{
|
||||||
${spaceshipMembers}
|
${spaceshipMembers}
|
||||||
return ${ordering}::equivalent;
|
return ${ordering}::equivalent;
|
||||||
})";
|
})";
|
||||||
spaceshipOperatorIf = "#if defined(VULKAN_HPP_HAS_SPACESHIP_OPERATOR)";
|
spaceshipOperatorIf = "#if defined(VULKAN_HPP_HAS_SPACESHIP_OPERATOR)";
|
||||||
spaceshipOperator =
|
spaceshipOperator =
|
||||||
replaceWithMap( spaceshipOperatorTemplate, { { "name", structName }, { "ordering", spaceshipOrdering }, { "spaceshipMembers", spaceshipMembers } } );
|
replaceWithMap( spaceshipOperatorTemplate, { { "name", structName }, { "ordering", spaceshipOrdering }, { "spaceshipMembers", spaceshipMembers } } );
|
||||||
spaceshipOperatorElse = "#endif\n";
|
spaceshipOperatorElse = "#endif\n";
|
||||||
spaceshipOperatorEndif = "";
|
spaceshipOperatorEndif = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user