
19 Dec
2024
19 Dec
'24
5:50 p.m.
On Thu, Dec 19, 2024 at 6:26 PM Neil Groves via Boost
One aspect that strikes me about all of our alternatives is that none of them work particularly well when we are using multi_ associative containers.
If I understand your comment correctly: "correct" return type is a std::ranges::subrange, equal_range returns std::pair so you need some helper to "rangify" that pair. (this example uses biset so you can ignore .get<1>).
EmployeeSet ems{{1, "Alice"}, {2, "Bob"}, {3, "Chad"}, {4, "Alice"}}; for (const Employee& employee : ems.get<1>().equal_range("Alice") | rangify) { std::print("{} {}\n", employee.id, employee.name); }