vigra icon indicating copy to clipboard operation
vigra copied to clipboard

deprecated implicit member functions

Open lnw opened this issue 2 years ago • 5 comments

I'm getting a large number of Wdeprecated-copy warnings with g++-11/linux, wrt different classes where either the copy ctor is used while the copy-assignment operator is implemented or the other way round. According to the rule of five declaring either of them prevents the implicit generation of the others.

Is this (including the omission of move ctors and move assignment operators) intentional, in order to support pre-C++-11 standard versions? Otherwise I'd make a pull request.

lnw avatar May 26 '22 18:05 lnw

The code certainly dates back to pre-C++-11 days, and VIGRA's inventor and maintainer is no longer working on this, openly speaking, so we do not have anyone right now who is clearly responsible for such a decision.

What would be your suggestion?

hmeine avatar Jun 08 '22 11:06 hmeine

I think the main three things to consider are that:

  • my suggested change would be breaking for anyone who wants to include vigra headers into their project and use <= C++03
  • g++-11 gives warnings in the current form. I think they may be errors in the future or for other compilers (g++ is usually quite forgiving).
  • Adding the currently missing move ctors / move assignment operators may have some small performance benefits.

So the main question is whether there are any/many users who rely on pre-C++-11 code that need to be considered. I have no idea about that. Disregarding that constraint, there are clear benefits in updating to C++-11.

lnw avatar Jun 08 '22 21:06 lnw

i'm definitely fine modernizing the codebase.

I would like to do it some order that resembles: https://github.com/ukoethe/vigra/issues/515

hmaarrfk avatar Oct 23 '22 00:10 hmaarrfk

the problem described above is fixed by my pull request #507. That should be good to go as it is.

lnw avatar Oct 23 '22 00:10 lnw

ok thank you. i'm getting the CIs back up and running. I might be interested to create a "release" before more intruisive changes.

hmaarrfk avatar Oct 23 '22 14:10 hmaarrfk