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

[C++20] explcit cast Radians to double in comparison #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lukaszgemborowski
Copy link

While compiling a project with -std=c++20 using gcc this error pops up:

libnest2d/include/libnest2d/nester.hpp:320:22: error: ambiguous overload for ‘operator!=’ (operand types are ‘libnest2d::Radians’ and ‘libnest2d::Radians’)
  320 |         if(rotation_ != rot) {
      |            ~~~~~~~~~ ^~ ~~~
      |            |            |
      |            |            libnest2d::Radians
      |            libnest2d::Radians

There's no != operator defined for Radians object, therefore explicit cast to underlying double representation is required.

PS. I am not sure what change in C++20 standard causes this problem.

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.

1 participant