Merge pull request #657 from asuessenbach/ArrayProxy

Change all functions with ArrayProxy[NoTemporaries] as arguments to take by const reference instead of by value.
This commit is contained in:
Andreas Süßenbach 2020-07-02 16:15:59 +02:00 committed by GitHub
commit 3c798197a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 809 additions and 778 deletions

View File

@ -2798,7 +2798,7 @@ void VulkanHppGenerator::appendFunctionHeaderArgumentEnhancedVector( std::string
// otherwise, use our ArrayProxy
bool isConst = ( param.type.prefix.find( "const" ) != std::string::npos );
str += optionalBegin + "ArrayProxy<" +
( isTemplateParam ? ( isConst ? "const T" : "T" ) : stripPostfix( param.type.compose(), "*" ) ) + "> " +
( isTemplateParam ? ( isConst ? "const T" : "T" ) : stripPostfix( param.type.compose(), "*" ) ) + "> const &" +
optionalEnd + strippedParameterName;
}
}
@ -3834,7 +3834,7 @@ void VulkanHppGenerator::appendStructSetter( std::string & str
}
static const std::string setArrayTemplate = R"(
${templateHeader}${structureName} & set${ArrayName}( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<${memberType}> ${arrayName} ) VULKAN_HPP_NOEXCEPT
${templateHeader}${structureName} & set${ArrayName}( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<${memberType}> const & ${arrayName} ) VULKAN_HPP_NOEXCEPT
{
${lenName} = ${lenValue};
${memberName} = ${arrayName}.data();

File diff suppressed because it is too large Load Diff