Let\'s imagine you need to call the following method:
std::tuple foo();
In C++17, you can call the function and unpack
MSVC has already fixed this in VS 15.7 Preview. The final 15.7 release should be available in the coming weeks. This means that the current logic supported by the latest releases of all major compilers is as follows:
If none of the bindings in a structured binding declaration are used, it is possible to silence the warning by using the [[maybe_unused]]
attribute:
[[maybe_unused]] auto [a, b, c] = foo();