Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
0 points
Koshkin
3y ago
0 comments
Share
One other thing that have felt the need to solve was iteration through the values as if it was a container, i.e. using the range-based for loop.
undefined | Better HN
0 comments
default
newest
oldest
mehrdadn
3y ago
That's supported here! You can do:
for (auto const &member : enum_traits<E>::members()) { std::cout << member.name() << std::endl; }
j
/
k
navigate · click thread line to collapse