Re: [Development] QProperty and library coding guide

2020-07-19 Thread Thiago Macieira
On Sunday, 19 July 2020 14:42:24 PDT Giuseppe D'Angelo via Development wrote: > * change /*2*/ to use ASM. We know the ABI of the platforms we support > and we know how to calculate the correct pointer value, we just need to > stop C/C++ from reason about it and flagging it as possible UB. Yes, >

Re: [Development] QProperty and library coding guide

2020-07-19 Thread André Somers
On 16-07-2020 13:08, Edward Welbourne wrote: Il 16/07/20 12:43, Volker Hilsheimer ha scritto: For pre-C++20 (where it’s possible to have zero-size structs), and for compilers that don’t respect the [[no_unqiue_address]] attribute, all these struct-instances are put into a union. In that case,

Re: [Development] QProperty and library coding guide

2020-07-19 Thread Giuseppe D'Angelo via Development
Il 19/07/20 20:42, Thiago Macieira ha scritto: In that sense, Peppe's suggestion of C++17 offsetof is better. To clarify, I was proposing to do something like this: Type Klass::_qt_property_api_propertyName::value() const { /*1*/ const size_t propertyMemberOffset =

Re: [Development] QProperty and library coding guide

2020-07-19 Thread Ville Voutilainen
On Sun, 19 Jul 2020 at 21:52, Thiago Macieira wrote: > > On Sunday, 19 July 2020 08:20:01 PDT Thiago Macieira wrote: > > 1. Revert the feature. > > 2. Write papers to add necessary functionality to C++23, like reversing a > >pointer-to-member-object back to the containing object > > 3.

Re: [Development] QProperty and library coding guide

2020-07-19 Thread Thiago Macieira
On Sunday, 19 July 2020 08:20:01 PDT Thiago Macieira wrote: > 1. Revert the feature. > 2. Write papers to add necessary functionality to C++23, like reversing a >pointer-to-member-object back to the containing object > 3. Require C++23 in Qt 7.0 > > double

Re: [Development] QProperty and library coding guide

2020-07-19 Thread Thiago Macieira
On Sunday, 19 July 2020 03:51:00 PDT Oswald Buddenhagen wrote: > - the compiler becomes intentionally belligerent, in which case an >override switch will be provided as well (if not instantly, then after >the outcry that immediately follows) Even if that were the case, we'd need

Re: [Development] QProperty and library coding guide

2020-07-19 Thread Ville Voutilainen
On Sun, 19 Jul 2020 at 15:25, Oswald Buddenhagen wrote: > (side effects of) actual optimizations are by definition not intentional > belligerence. (one would, however, expect that entire chunks of code > being thrown away would result in a warning that informs about > specifically that (and not

Re: [Development] QProperty and library coding guide

2020-07-19 Thread Oswald Buddenhagen
On Sun, Jul 19, 2020 at 01:14:08PM +0200, Giuseppe D'Angelo via Development wrote: offsetof is conditionally-supported for non standard layout classes in C++17.: oh, good. that means that the second line should also keep working, as that is semantically equivalent with offsetof being

Re: [Development] QProperty and library coding guide

2020-07-19 Thread Giuseppe D'Angelo via Development
Il 19/07/20 12:51, Oswald Buddenhagen ha scritto: - the compiler becomes intentionally belligerent, in which case an override switch will be provided as well (if not instantly, then after the outcry that immediately follows) File under "surely no compiler will optimize away X!", for X

Re: [Development] QProperty and library coding guide

2020-07-19 Thread Giuseppe D'Angelo via Development
Il 19/07/20 12:51, Oswald Buddenhagen ha scritto: - the compiler somehow starts to actually make use of the freedom granted by the fact that QObject is not standard-layout (this, btw, is also the reason why peppe's suggestion to use offsetof doesn't fix UB). offsetof is

Re: [Development] QProperty and library coding guide

2020-07-19 Thread Oswald Buddenhagen
On Sat, Jul 18, 2020 at 10:10:41AM -0700, Thiago Macieira wrote: On Friday, 17 July 2020 23:32:41 PDT Simon Hausmann wrote: This hack has been in QtQml in production since its release in 2010 (see static cast selector). It would be a shame if this stopped working The problem here is the

Re: [Development] QProperty and library coding guide

2020-07-19 Thread Sze Howe Koh
On Sat, 18 Jul 2020 at 03:58, Ulf Hermann wrote: > > > I must be missing something. I tend to think of eventloops with notify > > signals are an improvement over polling. You statement seems to say > > that asking for a value is better, and notifications are to be avoided? > > I'm not saying