Open HildarTheDorf opened 2 months ago
Ah, how nice it'd be if C++ had built-in ignores like Rust or C#; then we could just write auto const& [_, imageIndex] = ...
.
In the mean time, this sounds like a reasonable request, I'll work on it.
@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.
Currently it is possible to do the following as
ResultValue<T>
provides a cast operator tostd::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 tostd::tuple
, or write a helper function that does such. Would it be possible to altervk::ResultValue
to allow this implicitly?[^1]: Note that the actual usefulness of ignoring the result of vkAcquireNextImageKHR is beyond the scope of this issue.