forked from microsoft/cppwinrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Feature: Investigate the MSVC extension __declspec property #23
Copy link
Copy link
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationexternalFix this issue may require improvements to external toolsFix this issue may require improvements to external toolsfeatureNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Activity
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationexternalFix this issue may require improvements to external toolsFix this issue may require improvements to external toolsfeatureNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Currently, this extension is supported by MSVC, Clang, and EDG (Intellisense), but not by GCC. It is necessary to check for any unexpected behavior of this extension on MSVC and Clang. If it is available, consider introducing this feature for C++/WinRT Plus. The option -getter-extension needs to be added and options also need to be added for MSBuild.
This extension will bring a C#-like experience to C++ users and help C# users adapt.
Add option -ms-extension-property. When this option is enabled, the function names of the current runtime class's properties will be changed to _get_Property and _set_Property, and the member declaration __declspec(property(get = _get_Property, put = _set_Property)) T Property; will be added.
Doc: https://learn.microsoft.com/en-us/cpp/cpp/property-cpp?view=msvc-170