http://msdn.microsoft.com/en-us/library/es7h5kch.aspx
This feature looks pretty sweet. This would be great because you wouldn't need getters any more. You could make member variables public; later, if you change your mind, you can turn them into property.
Is this something that the standard committee has considered? Is this something they would likely accept or reject? Does this already exist and I just don't know about it yet?
Your PC will continue to start and run, but you will no longer receive software updates, including security updates, from Microsoft. For full details about the support policy, see the Microsoft Support Lifecycle Policy FAQ.
Though Microsoft released the new Windows 11 2022 Update to consumers today, there's no obligation to upgrade. Microsoft will continue to support Windows 10 through October 2025, company executives said.
Extended Support typically lasts about 5 years after the end of Mainstream Support. During Extended Support, Microsoft continues to provide security and reliability updates, and bug fixes, but non-security updates are not provided without a paid support agreement.
Since this is already possible in standard-compliant C++ using a library-only approach (proxy objects), it's unlikely to see language changes and new keywords. Unlike lambdas (for instance), the possible syntactic sugar here isn't all that sweet (doesn't change the level of abstraction much).
BTW, changing fields (wrapperless member variables) into properties is always a breaking change, because you can form pointers and references to fields and read/write them directly. With a property, you'd need a wrapper in order to ensure that the getters and setters are used.
The reason for the Microsoft extension is that it doesn't simply provide properties (interception of read and write to getter and setter functions) in C++ code. It generates .NET metadata or WinRT metadata (in C++/CLI and C++/CX, respectively) which is used by reflection. Standard C++ doesn't have reflection or metadata.
Also note that C++ developers tend not to use the proxy object pattern very much, which indicates to the committee that there isn't much demand for a "cleaner" syntactic sugar, either.
This is old. Borland added it first, back in 90s, with C++ Builder if I'm not mistaken. Microsoft followed suit, they were highly competitive back then. COM Automation was a pretty major motivator.
Given that this had three C++ language versions to stew, along with the controversy around it, the odds that this will be considered for a future revision are about zilch.
Properties have their use but they cause considerable implementation difficulties. Passing a property by reference for example is a very difficult problem to solve. The callee would need to know that an accessor needs to be called, instead of just dereferencing a pointer, and would need to know whether a getter or setter even exists. The only practical solution is to just forbid it, not exactly attractive in C++. Additional problems add up when you start to support default properties, very hard to pass up, introducing syntax ambiguity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With