On Fri, 21 Feb 2020 at 14:21, Ville Voutilainen <ville.voutilai...@gmail.com> wrote: > > On Fri, 21 Feb 2020 at 14:00, Allan Sandfeld Jensen <k...@carewolf.com> wrote: > > Hmm.. Or perhaps: > > > > #define qEmit(x) x > > or > > #define qEmit(x) do { x; } while (false) > > to handle the syntactic edge cases. > > Well, if we're re-entertaining a function-like wrapper, we could just > as well avoid > getting back to the not-so-wonderful world of macros, and do > template <class T> T&& qEmit(T&& t) {return std::forward<T>(t);}
..but this doesn't really work, because it turns prvalues into xvalues, and thwarts lifetime extension of reference to prvalues, so scratch that idea. _______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development