Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Deprecating THISBACK (Post 2020.2 release)
Re: Deprecating THISBACK [message #55125 is a reply to message #55122] Mon, 12 October 2020 23:25 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
Klugier wrote on Mon, 12 October 2020 22:31
Hello,

I had the discussion with Mirek about this article https://evileg.com/en/post/629/ he found that the user uses deprecated THISBACK construction. Well we deprecated it in the documentation in favor or lambdas or newer c++ constructions such as Function, Gate etc.

In c++14 which we targets on all platforms the solution is easy. We can deprecate it on compilation level, which means something. Just mark THISBACK with deprecated atribute like this:
[[deprecated("THISBACK is deprecated use lambda instead.")]]
const int thisbackd = 0;

#define THISBACK(x)                  callback(this  + thisbackd, &CLASSNAME::x)
#define THISBACK1(x, arg)            callback1(this + thisbackd, &CLASSNAME::x, arg)
#define THISBACK2(m, a, b)           callback2(this + thisbackd, &CLASSNAME::m, a, b)
#define THISBACK3(m, a, b, c)        callback3(this + thisbackd, &CLASSNAME::m, a, b, c)
#define THISBACK4(m, a, b, c, d)     callback4(this + thisbackd, &CLASSNAME::m, a, b, c, d)
#define THISBACK5(m, a, b, c, d, e)  callback5(this + thisbackd, &CLASSNAME::m, a, b, c, d,e)

Then in all places when THISBACK is used the warning pop up "/home/klugier/upp/uppsrc/CtrlLib/FileSel.h (239): warning: 'thisbackd' is deprecated: THISBACK is deprecated use lambda instead. [-Wdeprecated-declarations]".

I think we have multiple places when [[deprecated]] macro can be used. If you search for "deprecated" in uppsrc then there is around 52 entries... Definitely not the topic for 2020.2, but for 2021.1...

Klugier


I generally hate this. This would mean that I would have to fix a tons of code to avoid that warning for no good reason. Like a week of work...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Previous Topic: ClearModifyDeep() error ??
Next Topic: DarkThemeCached
Goto Forum:
  


Current Time: Thu Jun 06 11:28:51 CEST 2024

Total time taken to generate the page: 0.01478 seconds