boostorg / boostorg/pfr

Feature request: for_each_field multiple visitation

Aperta
#69 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
C++
Stelle
1.5k
Fork
176
Merge medio
5g 21h
PR unite (30g)
1

Descrizione

Multiple visitation is easy enough to achieve with a library like Boost.Hana (see below), but I think it would be useful functionality for ```for_each_field``` to support directly.

```cpp
template
constexpr auto for_each_field(Invocable f, Aggregates&&... xs) -> void
{
namespace hana = boost::hana;
hana::for_each(hana::zip(boost::pfr::structure_tie(xs)...), hana::fuse(std::move(f)));
}
```
[Example on Compiler Explorer](https://godbolt.org/z/K9Krfh)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.