tamasmeszaros / libnest2d

2D irregular bin packaging and nesting library written in modern C++
GNU Lesser General Public License v3.0
315 stars 104 forks source link

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

Open lukaszgemborowski opened 7 months ago

lukaszgemborowski commented 7 months ago

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.