-
Notifications
You must be signed in to change notification settings - Fork 526
Wrap C++ structs as C# structs where appropriate #500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@ddobrev |
@ddobrev Any comment?! |
Getting this working would be a huge benefit to many APIs cases we've run into. Currently we end up writing a dummy class to wrap the struct with getters/setters to access the fields. It is a lot of wasted effort when a C++ struct can be easily be represented in C#. |
Structs and classes are essentially the same in C++. However, the way they are used is almost identical as they way they are in C#. So it would be a good idea if a C++ struct is mapped to a C# struct. That is not always convenient - for example, if the struct is inherited, we won't be able to directly mirror that in C# since deriving from structs is forbidden there. Therefore in such cases mapping to a struct would cause more problems than it solves.
So the algorithm should:
Note: manual marking of types as structs must be left to give freedom to binders.
The text was updated successfully, but these errors were encountered: