Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
quinnftw
on April 12, 2017
|
parent
|
context
|
favorite
| on:
Mapping Strings in C++
I thought this aswell, but you have it backwards. The point is to convert a string to it's corresponding enum, not the other way around.
toth
on April 12, 2017
[–]
I get that part, that's why you use std::find or std::lower_bound on the vector, but my point is that std::lower_bound will not give you the right answer unless your enum is defined with the names in alphabetical order.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: