-
Notifications
You must be signed in to change notification settings - Fork 13.3k
The use of bind in Ticker.h is prone to type inference failure #6129
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
Conversation
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.
Can you please give an example of failed type inference for these use cases?
The error message when std::bind is used looks like this:
Too bad it doesn't actually list the candidates, I deduce that what's giving the compiler hiccups here is the choice of rValue reference and const reference overload signatures of schedule_function in Schedule.h, which goes like this:
|
During development of a different Schedule.h queue, it turns out that the use of std::bind has nasty issues with ambiguous type inference. The use of lambdas is generally encouraged in current C++, so this PR refactors the two spots where std::bind is used.