Introduce helper function ResultValue<UniqueHandle<Type, Dispatch>>::asTuple()

Allows coding like this:

    vk::Result         result;
    vk::UniquePipeline pipeline;
    std::tie( result, pipeline ) =
      device->createGraphicsPipelineUnique( nullptr, graphicsPipelineCreateInfo ).asTuple();
This commit is contained in:
asuessenbach
2020-09-16 09:36:37 +02:00
parent 0bacbdd449
commit 0b8e4cb938
3 changed files with 19 additions and 7 deletions

View File

@@ -16369,8 +16369,10 @@ namespace VULKAN_HPP_NAMESPACE
, value( std::move( v ) )
{}
Result result;
UniqueHandle<Type, Dispatch> value;
std::tuple<Result, UniqueHandle<Type, Dispatch>> asTuple()
{
return std::make_tuple( result, std::move( value ) );
}
# if !defined( VULKAN_HPP_DISABLE_IMPLICIT_RESULT_VALUE_CAST )
VULKAN_HPP_DEPRECATED(
@@ -16387,6 +16389,9 @@ namespace VULKAN_HPP_NAMESPACE
return std::move( value );
}
# endif
Result result;
UniqueHandle<Type, Dispatch> value;
};
template <typename Type, typename Dispatch>