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
So, this code
template<class...Match>
bool search(char ch, Match&&...matchers) {
return (matchers(ch) || ...);
}
search('A', ::isalpha, ::isdigit, { lambda });
gets insighted into
bool search<... params...>(char ch, int (&matchers)(int) noexcept, int (&matchers)(int) noexcept, __lambda_12_50 && __matchers3)
Notice how first and second parameters are named 'matchers', but the third parameter is named 'matchers3'. It looks like there is an internal counter, it is just being output for lambda and not for regular function argument.
The text was updated successfully, but these errors were encountered:
thanks for reporting this. You're right. There is a counter, the one Clang, assigned to each parameter. C++ Insights uses this counter is based on the query whether some parameter is part of a parameter pack. This function is here InsightsHelpers.cpp.
Now for the example you provided, the check says that it is only an RValue or LValue reference (depending on the parameters). There is no glue I could find that indicates that this parameter comes from a parameter pack.
That issue will remain unfixed unless someone can show me how to get this information.
https://cppinsights.io/s/5ced24b2
So, this code
template<class...Match>
bool search(char ch, Match&&...matchers) {
return (matchers(ch) || ...);
}
search('A', ::isalpha, ::isdigit, { lambda });
gets insighted into
bool search<... params...>(char ch, int (&matchers)(int) noexcept, int (&matchers)(int) noexcept, __lambda_12_50 && __matchers3)
Notice how first and second parameters are named 'matchers', but the third parameter is named 'matchers3'. It looks like there is an internal counter, it is just being output for lambda and not for regular function argument.
The text was updated successfully, but these errors were encountered: