Guard use of ArrayProxyNoTemporaries with structure setter functions

This commit is contained in:
asuessenbach 2020-07-09 12:20:43 +02:00
parent d9a88324d8
commit db7695f18f
2 changed files with 295 additions and 1 deletions

View File

@ -3812,7 +3812,7 @@ void VulkanHppGenerator::appendStructSetter( std::string & str
std::string templateHeader; std::string templateHeader;
if ( member.type.type == "void" ) if ( member.type.type == "void" )
{ {
templateHeader = "template <typename T>\n"; templateHeader = "template <typename T>\n ";
size_t pos = memberType.find( "void" ); size_t pos = memberType.find( "void" );
assert( pos != std::string::npos ); assert( pos != std::string::npos );
@ -3830,12 +3830,14 @@ void VulkanHppGenerator::appendStructSetter( std::string & str
} }
static const std::string setArrayTemplate = R"( static const std::string setArrayTemplate = R"(
#if !defined(VULKAN_HPP_DISABLE_ENHANCED_MODE)
${templateHeader}${structureName} & set${ArrayName}( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<${memberType}> const & ${arrayName}_ ) VULKAN_HPP_NOEXCEPT ${templateHeader}${structureName} & set${ArrayName}( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<${memberType}> const & ${arrayName}_ ) VULKAN_HPP_NOEXCEPT
{ {
${lenName} = ${lenValue}; ${lenName} = ${lenValue};
${memberName} = ${arrayName}_.data(); ${memberName} = ${arrayName}_.data();
return *this; return *this;
} }
#endif // !defined(VULKAN_HPP_DISABLE_ENHANCED_MODE)
)"; )";
str += replaceWithMap( setArrayTemplate, str += replaceWithMap( setArrayTemplate,

File diff suppressed because it is too large Load Diff