Closed ikbenkous closed 8 months ago
Why should we mark as deprecated instead of simply removing it?
Having a way to mark functions as 'deprecated' allows us to keep functions around yet signal to others: do not build on this! It's a nice feature to have to improve collaboration.
For instance: the isSameFreq()
should probably be deprecated when the Frequency
class is finally implemented. Implementing that class is the easy part. Upgrading the code to use that new class might take a while. Hence: the ability to mark isSameFreq()
as 'deprecated' during that transition period is a smart thing to do.
I'm sure there are (and will be in the future) plenty of cases where deprecating something until someone gets around to remove/rewrite is just a really nice enhancement!
A KLOG_DEPRECATED
macro or some other way(!!!) of deprecating things must be language version agnostic. It should not use language features not available in C++11 until the language version is upgraded.
It really makes sense. Let's work on it.
I have added your code to global.h and tested against DataProxy_SQLite::getBands() which is really a deprecated function. It seems to work. More tests is recommended.
How can one mark a function as deprecated?
C++14 and later has a
[[deprecated]]
attribute, but klog is compiled with-std=gnu++11
.What about the following in global.h?
One can then mark a function as deprecated as follows:
Thoughts?