Add marshalling for std::optional <=> System::Nullable#1902
Conversation
|
Do you want to add a CLI-only test for this in https://github.com/mono/CppSharp/blob/main/tests/dotnet/CLI/CLI.h? |
|
By the way, given this is C++/CLI only, how come its being used in the bootstrap update PR? I don't think it's implemented in C#, so won't it lead to different APIs in non-Windows platforms? |
|
Ehm, well, if you update the bootstrap source, you also need to update the parser bindings. (Including the C++/CLI ones). So for example Expr.cs:2144 which is converted here. That said, I think it's possible to also implement the same thing in |
Yeah it seems like it should be possible to implement for C# too. My remark before is because as far as I can tell, with this just implemented for C++/CLI as in this PR, won't it lead to CppSharp generating incompatible .NET bindings between C++/CLI and C# backend? |
|
Sorry, in that case I'm having a hard time understanding what you mean. I think I'm missing some context. All I can say though, is that I simply followed the implementation for |
What I was thinking is that generally CppSharp tries to provide a uniform API for the generated bindings, for the .NET generators (C++/CLI and C#), and having differently supported type maps will probably make that not be the case. But you make a good point that's already the case with |
Should be mapped, since that's an almost one to one conversion.
Might want to create a test for this one