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

Marc Mutz marc.mutz at kdab.com
Mon Feb 17 07:17:11 CET 2020


On 2020-02-16 19:32, Thiago Macieira wrote:
> On Saturday, 15 February 2020 06:23:52 PST Marc Mutz via Development 
> wrote:
>> C++20 will contain new classes with emit() member functions
>> (wg21.link/P0053). While that will only pose problems for users that
>> include the new <osyncstream> header after (almost) any Qt header, 
>> this
>> should serve as a second shot across the bows (after namespace
>> boost::signals) that we should change something.
> 
> Orthogonal to your request: can we ask C++20 to change the name of this
> function? We've been #define'ing emit for nearly 30 years.

I did. There was no consensus for a change (not by a long shot).

If it had been just the basic_syncbuf version, which returns bool, it 
might have been possible to change that to try_emit, but the 
basic_osyncstream version sets failbit, and returns void, so naming that 
one try_emit would be awkward, and a full bikeshdding about a different 
stem than 'emit' was asking for too much.

Thanks,
Marc


More information about the Development mailing list