These are chat archives for boostorg/hana

8th
Oct 2017
Martchus
@Martchus
Oct 08 2017 15:07
To find a member by its name and the name is only known at run-time, I have to 'find it manually' by iterating over the members with hana::for_each (because hana::at_key only takes a compile-time string). Correct?
Jason Rice
@ricejasonf
Oct 08 2017 18:36
Yeah, at_key requires a compile-time Comparable key.
The problem with using hana::for_each for that is that it will not short circuit. To do a run-time value to type mapping I use boost::mp11::find_with. This issue lists a few more libraries for this sort of thing. boostorg/hana#353
Martchus
@Martchus
Oct 08 2017 19:50
Thanks for the response.
Martchus
@Martchus
Oct 08 2017 20:37
You're talking about https://github.com/boostorg/mp11 ? I'm asking becauseboost::mp11::find_with doesn't seem to be available anymore.
Jason Rice
@ricejasonf
Oct 08 2017 22:19
ah.. sorry. It's called with_index