On Wed, Sep 17, 2025 at 08:19:39AM +0100, Michael Buch via Dwarf-discuss wrote:
> Since then two more kinds of packs have been added to the language:
> 3. lambda capture packs (C++20)
> 4. structured binding packs (C++26)

I've mentioned structured binding packs and they were agreed to be handled
in a later proposal I think.  I think lambda capture packs weren't mentioned
so far.

> # Structured Binding Packs
> 
> Here is an example of such pack:
> ```
> struct C { int x = 1, y = 2, z = 3; };
> 
> void foo() {
>   auto [d, ...e] = C();
> }

This is not a valid structured binding pack, it needs to be used in a
template.
So say
```
struct C { int x = 1, y = 2, z = 3; };

template<int N>
void foo() {
  auto [d, ...e] = C();
}
```
would be a valid testcase.

        Jakub

-- 
Dwarf-discuss mailing list
[email protected]
https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss

Reply via email to