You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code close to the following was noted in many user applications:
booltest1(const std::vector<std::string_view>& in) {
return in == std::vector<std::string_view>{"*"};
}
Here people wish to make sure that the vector contains only a single "*" element. In other words they assume that the above code snippet would be optimized to something like:
The loop optimizer isn't handling the size() call well; the whole thing optimizes much better with the following (obviously not correct in general, but should be equivalent here):
Code close to the following was noted in many user applications:
Here people wish to make sure that the vector contains only a single "*" element. In other words they assume that the above code snippet would be optimized to something like:
Unfortunately that does not happen: https://godbolt.org/z/8WThj5Mrq
Note that all the functions are inlined however the new+delete are not elided.
Minimized example: https://godbolt.org/z/T8a8a8nxq
The text was updated successfully, but these errors were encountered: