[Interest] deprecating class methods gracefully

René J.V. Bertin rjvbertin at gmail.com
Mon Nov 7 01:10:48 CET 2016


On Sunday November 06 2016 23:21:23 Allan Sandfeld Jensen wrote:

Hi,

> If it is just a static method, you can just move the whole thing to a separate 
> cpp file. It doesn't need to be declared with the rest of the class. 

So that file would in fact redeclare the class, containing only the static method? That'd basically be the clean way of doing what I had in mind, I think. Thanks.

> Note that just makes it ABI compatible, but not source compatible. The usual 
> method for source compatible is just declaring it deprecated, C++ has function 
> attributes for that now.

Yes, but does that more than just print a warning? What I'm trying to do is phase out use of this method, but as long as I simply declare the thing deprecated software will continue to use it instead of the parent method it overrides. In this case source compatibility is handled through inheritance, and I only care about ABI compatibility because rebuilding all dependent code is too disruptive to be justified by what is basically just a bit of API cleanup.

R.



More information about the Interest mailing list