This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/106255/ |
On August 28th, 2012, 7:20 p.m., Thomas Lübking wrote:
One could probably override the "->" operator to return NULL function pointers what makes them noop and also returns false (::isActive() etc.) but i'd have to try myself, so i'm not sure whether that works. <- Code Fu masturbation ;-) Another option was to make ::isActive (and some other functions) static as well. *shrug*On August 28th, 2012, 8:16 p.m., Martin Gräßlin wrote:
I first wanted to do the ::isActive but decided then to add just the ::isCreated as it's kind of strange to make everything static. But override the operator-> sound interesting but also a little bit academic ;-)
The hidden danger in overriding operator::-> is that any function that should default to anything but false/0 will depending on the compositor instance default to NULL instead. Given that ::isActive will be the most interesting condition for "external" callers and the return in absence of a compositor is defined, i'd vote to make at least that one static next to ::isCreated - and leave wonky pointer experiments to things with a lower amount of users ;-)
- Thomas
On August 30th, 2012, 9:23 a.m., Martin Gräßlin wrote:
Review request for kwin.
By Martin Gräßlin.
Updated Aug. 30, 2012, 9:23 a.m. Description
Diffs
|