Allow destructuring of ResultValue with std::tie
Currently it is possible to do the following as ResultValue<T> provides a cast operator to std::tuple<vk:Result, T>:
const auto [acquireResult, imageIndex] = _device->acquireNextImageKHR(...);.
I would like to be able to do this: std::tie(std::ignore, _imageIndex) = _device->acquireNextImageKHR(...);[^1] however it currently fails to compile.
As a work around I either have to static_cast the ResultValue to std::tuple, or write a helper function that does such. Would it be possible to alter vk::ResultValue to allow this implicitly?
[^1]: Note that the actual usefulness of ignoring the result of vkAcquireNextImageKHR is beyond the scope of this issue.
@sharadhr This is already in C++26 https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2169r4.pdf
std::tie(result, backBufferIndex) = swapchainData.swapchain.acquireNextImage(...) is an actual snippet from my C++20 sample... std::ignore works in place of result as well. I'm using Vulkan SDK 1.3.280.0.
Would it be possible to alter
vk::ResultValueto allow this implicitly?
Yes, that would be possible.
But I doubt, it would be useful to have such a capability. Simplifying to ignore (part of) a vk::ResultValue is probably not the right move.