-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reflect enum type #204
Reflect enum type #204
Conversation
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #204 +/- ##
==========================================
+ Coverage 42.94% 43.52% +0.58%
==========================================
Files 44 45 +1
Lines 5305 5333 +28
==========================================
+ Hits 2278 2321 +43
+ Misses 3027 3012 -15
☔ View full report in Codecov by Sentry. |
你是假定enum 值是连续的吗?enum 的值不一定是连续的,可能是200, 400, 500, 甚至更大,还有可能是负数。 |
33fe543
to
86fcd97
Compare
if (it != str_to_enum.end()) | ||
IGUANA_LIKELY { value = it->second; } | ||
else { | ||
throw std::runtime_error(std::string(enum_names) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个分支覆盖到了吗,确保每个分支都覆盖到。
No description provided.