Skip to content
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

Fix ReturnAndSet() compile error when using incompatible argument types #266

Merged
merged 2 commits into from
May 1, 2022

Conversation

hedayat
Copy link
Contributor

@hedayat hedayat commented Apr 14, 2022

Fixes #265

It present a sub-optimal solution for C++ < 17, since it catches type incompatibility problems at runtime rather than during compile time. But at least, it works.

It is probably possible to make it work at compile time, specially for C++14; but I'm not sure I'll go for it.

@coveralls
Copy link

coveralls commented Apr 14, 2022

Coverage Status

Coverage increased (+9.0e-05%) to 99.926% when pulling 47d24cf on hedayat:master into 98979d2 on eranpeer:master.

@FranckRJ
Copy link
Collaborator

I'll look into it this weekend. I'll try as well to make the static check compatible for C++11 (or maybe at least C++14) but I'm afraid that, as you said, it will be a bit too complicated.

@hedayat
Copy link
Contributor Author

hedayat commented Apr 28, 2022

I'll look into it this weekend. I'll try as well to make the static check compatible for C++11 (or maybe at least C++14) but I'm afraid that, as you said, it will be a bit too complicated.

That'd be great. I'm sorry that I'm a bit lazy to work on C++11 compatibility (I consider it too old these days :P ).

@FranckRJ
Copy link
Collaborator

FranckRJ commented May 1, 2022

I'll admit that I'm a bit lazy as well, I've looked a bit and I have no idea how to make the compile-time check compatible with C++11 (without rewriting a std::get). I'll ship it like that because it fix a bug so the faster it's in a release the better, and support for older versions of C++ can still be improved in a future update, so it's OK I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReturnAndSet won't compile with different argument types
4 participants