-
Notifications
You must be signed in to change notification settings - Fork 57
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
C++20 compilation failure disconnecting slots with boost::bind #45
Comments
I think it is a bind issue. Anyways, I can reproduce without signals2:
|
Yes, I'm quite willing to believe it's actually a bind issue. I've worked around the problem in our code so feel free to close this if you're happy there's nothing that needs fixing in signals2. |
It's not a Bind issue. The problem here is that Function and Bind want This is ordinarily not a conflict because both libraries only define However, C++20 has its own opinions on how This is not something that is possible to fix in either Bind or Function without breaking all uses of the corresponding |
On second thought, this might be possible to fix on the Function side. |
This specific issue is now fixed, but the original program still fails to compile under C++20, for other (similar) reasons that can't be addressed on the Function side. There's a change in C++23 that makes it compile, though. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2468r2.html |
The following test program:
Compiles fine with
g++ -std=c++17 main.cc
, but fails withg++ -std=c++20 main.cc
at the site of the disconnect call.The problem seems to be related to the
operator==
for the type returned by boost::bind (error from gcc 10, but a similar error is reported by other versions of gcc and clang):I'm not sure if this is a bug with the signals2 library, a bug with the bind library, or whether this form of disconnect is no longer supported and the documentation just doesn't make it clear, but since the point at which I encountered it was in using the signals2 library I'm reporting it here first.
The text was updated successfully, but these errors were encountered: