Hi Oktlryk,
sorry, in my answer
Best,
Sebastian
-----Ursprüngliche Nachricht-----
Von: Oktlryk via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Fr 08.07.2022 11:57
Betreff: [std-proposals] Quick Idea: Enable/Disable Auto Gens
An: std-proposals@lists.isocpp.org;
CC: Oktlryk <oktlryk@gmail.com>;
HelloI was doing a course over at Udemy on Unreal Engine C++ programming, and tons of the code (I mean there were a lotta functions involving this) enabled or disabled some boolean or set some value to true/false, as like in semaphore types.And I had to write two functions for each like: void EnableStuff() + void DisableStuff(). Which got me thinking, why not handle this at the language level. Like you could indicate if a function was a Enable/Disable actuator and only require the expressed inclusion of the function in definition. For example:void endis Stuff(bool setMe); // endis (Enable/Disable keyword)then when calling:Stuff.enable() = enable // sets setMe to trueStuff.disable() = disable // sets setMe to falseAnd C++ automatically generates the enable/disable switches, not requiring further function defs and so on!! This will definitely be a super cool improvement to the C++ QOL.-- Std-Proposals mailing list Std-Proposals@lists.isocpp.org https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals