4 ms·
I like it. It effectively adds a new keyword to the language that's only available if you include a header. The technique isn't pretty, but the result is pretty
by mikeash 11y ago
I like it. It effectively adds a new keyword to the language that's only available if you include a header. The technique isn't pretty, but the result is pretty nice IMO.
- marvy 11y agoBut I don't want to include a header just to use bool. I'm willing to include a header for big things (like strcmp), but bool is such a small convenience that it should be available without an include, because otherwise it's less work to just use an int than to go to the top of the file and add an include. Plus, I think the idea of putting each keyword behind an include gets annoying if you do this for a significant fraction of your keywords. (It's neat that you can, but... should you?) For instance, imagine if throw, class, and protected were all behind separate includes?