[Development] A modest proposal: disable lower-case keywords (emit, foreach, forever, signals, slots) by default

Ville Voutilainen ville.voutilainen at gmail.com
Fri Feb 21 13:51:35 CET 2020


On Fri, 21 Feb 2020 at 14:21, Ville Voutilainen
<ville.voutilainen at gmail.com> wrote:
>
> On Fri, 21 Feb 2020 at 14:00, Allan Sandfeld Jensen <kde at 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.


More information about the Development mailing list