|
|
|
|
|
|
|
|
|
|
auto barset = transform_view(bar_arr, &Foo::bar) | to<set>();
It's C++, but not as we know it, not as we know it, not as we know it; it's C++, but not as we know it, not as we know it. |
C++20/23 ranges is almost like learning to program again! |
std::transform(std::begin(bar_arr), std::end(bar_arr), std::inserter(barset, barset.end()), [](Foo f){return f.bar; });