Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Seems that it could be used to solve an old-time classic: generate a mapping from an enum value to its string representation. Another use case that comes to my mind is maybe automating test case generation. Occasionally I was running into situations where I thought code generation could be useful, but not sure what could be a "killer app" equivalent for this feature.

Related topic: standardizing reflection in c++. https://youtu.be/ARxj3dfF_h0 https://en.cppreference.com/w/cpp/keyword/reflexpr



Enum to string is a one-line expression in Circle: https://godbolt.org/z/93f5o77zv

Circle has dozens of special traits for accessing useful stuff about types, packs, etc. Don't need to overengineer such a simple thing.



What’s wrong with an array


that would be great :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: