-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Untag dispatch find #2380
Untag dispatch find #2380
Conversation
Co-authored-by: Michael Schellenberger Costa <[email protected]>
if (!_Within_limits(_First, _Val)) { | ||
return _Last; | ||
} |
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 change requested: I observe that originally, in C++20 when is_constant_evaluated()
was true
, we would perform the _Within_limits
check and early return if possible. Now, when is_constant_evaluated()
is true
, we simply activate the classic algorithm fallback. This seems fine, since at most there would be a minor throughput improvement, and it seems fairly unusual for the _Within_limits
check to actually be successful (when it isn't, we pay the cost of a branch).
That is, _Within_limits
is necessary for the runtime memchr
optimization, but it's not really valuable for the constexpr
case, and the new code is organized accordingly. 😸
Co-authored-by: S. B. Tam <[email protected]>
I'm going to add this to the next batch of changes to merge - please notify me if any further commits are pushed. |
Thanks for |
Towards #189
Extracted from #2219