forked from malte-v/VulkanMemoryAllocator-Hpp
-
Notifications
You must be signed in to change notification settings - Fork 41
vma::AllocatedBuffer asTuple #78
Copy link
Copy link
Closed
Description
I really want this code to work
using VmaAllocatedBuffer = std::pair<vma::UniqueAllocation, vma::UniqueBuffer>;
VmaAllocatedBuffer vma_allocated_buffer;
tie(vk_result, vma_allocated_buffer) = vma_allocator_->createBufferUnique(vk_buffer_create_info, vma_allocation_create_info).asTuple();
This probably requires specialization
struct ResultValue<std::pair<UniqueHandle<Type, Dispatch>, UniqueHandle<Type, Dispatch>>>
like
template <typename Type, typename Dispatch>
struct ResultValue<std::vector<UniqueHandle<Type, Dispatch>>>
{
# ifdef VULKAN_HPP_HAS_NOEXCEPT
ResultValue( Result r, std::vector<UniqueHandle<Type, Dispatch>> && v ) VULKAN_HPP_NOEXCEPT
# else
ResultValue( Result r, std::vector<UniqueHandle<Type, Dispatch>> && v )
# endif
: result( r )
, value( std::move( v ) )
{
}
VULKAN_HPP_DEPRECATED(
"asTuple() on an l-value is deprecated, as it implicitly moves the UniqueHandle out of the ResultValue. Use asTuple() on an r-value instead, requiring to explicitly move the UniqueHandle." )
std::tuple<Result, std::vector<UniqueHandle<Type, Dispatch>>> asTuple() &
{
return std::make_tuple( result, std::move( value ) );
}
std::tuple<Result, std::vector<UniqueHandle<Type, Dispatch>>> asTuple() &&
{
return std::make_tuple( result, std::move( value ) );
}
Result result;
std::vector<UniqueHandle<Type, Dispatch>> value;
};
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels