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

Matthew Woehlke mwoehlke.floss at gmail.com
Tue Feb 25 20:36:02 CET 2020


On 24/02/2020 07.34, Edward Welbourne wrote:
> Mitch Curtis (24 February 2020 13:22)
>> I don't think anyone has explained what that harm is yet.
> 
> #define emit
> 
> causes problems when you import a header that declares
> 
>   void emit(Type arg);
> 
> and the compiler sees
> 
>   void (Type arg);
> 
> and throws a wobbly.

- Until now, `emit` has rarely been used in code that needs to mix with Qt.

- C++20 will have modules.

- Modules are theoretically immune to the above issue.

Where, exactly, is the problem? It seems to me we are making a big deal
out of something that will *still* only be a problem when mixing Qt
(with no QT_NO_KEYWORDS) and *certain uses* of <osyncstream>.

This doesn't seem appreciably different from the existing situation with
boost::signals. Ergo, I am confused why we are all acting like the sky
is falling?

Maybe we should, at least, take a step back and wait to see if this
*actually affects many people* before worrying about it?

-- 
Matthew


More information about the Development mailing list