In C++17, I have a function returning multiple values via a std::tuple and structured bindings and I wish to ignore one of the return values and suppress any warnings related to that.
I tried the following which does not compile:
[const auto [outside, [[maybe_unused]] edge, inside] = Classify();
=> error: expected identifier before '[' token
I also tried this:
[[maybe_unused]] const auto [outside, edge, inside] = Classify();
=> warning: unused variable 'edge' [-Wunused-variable]
Neither works as desired with GCC v7.3.0.
Is there a way in C++17 to neatly specify that edge
is unused in a multiple value return syntax using structured bindings or is this missing from the current language definition?