ukoethe / vigra

a generic C++ library for image analysis
http://ukoethe.github.io/vigra/
Other
406 stars 191 forks source link

Use of deprecated std::unary_negate and std::binary_negate #534

Closed mkrausex closed 9 months ago

mkrausex commented 1 year ago

The file functortraits.hxx refers to std::unary_negate and std::binary_negate, which have been deprecated since C++17, and removed in C++20. Therefore, this file fails to compile under Visual Studio 2019 in C++20 mode, which is the environment the project I'm working on uses.

I commented these out (see attached patch), and my project is fine with that change. However, I’m not sure what implications that has on other code, and what a real fix could be.

lnw commented 1 year ago

The change looks completely reasonable to me.

Although, the fact that it works for your project only means that your project doesn't pass std::unary_negate to any high level vigra-function that would apply FunctorTraits to it. So, you are effectively removing functionality from the library. If we think that is used, one could write a replacement, but there isn't a simple drop in replacement.

hmaarrfk commented 9 months ago

Closed by https://github.com/ukoethe/vigra/pull/536

thank you