You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C++14 and later has a [[deprecated]] attribute, but klog is compiled with -std=gnu++11.
What about the following in global.h?
// If C++14
#if __cplusplus >= 201309L
// use modern deprecation feature
#defineKLOG_DEPRECATED [[deprecated]]
#else//... no idea how to handle this, but this seems overly noisy?
#defineKLOG_DEPRECATED
#warning "KLOG_DEPRECATED is not defined yet!"
#endif
One can then mark a function as deprecated as follows:
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.
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?
The text was updated successfully, but these errors were encountered: