-
Notifications
You must be signed in to change notification settings - Fork 514
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
Fix #1251 three parameter equality operator #1776
Conversation
- Operators in generic classes do not attempt to generate as extension methods anymore - Empty `...Extensions` classes are no longer generated - `string` as a template argument is correctly cast - `MarshalCharAsManagedChar` option also generates correct casts - Suppress warning regarding returning struct field by ref - Eliminate some tabs that snuck into the test C++ header
Fixes #1251 |
Do you mean force the symbols to get exported in the shared library? If so, you can see how we do it in https://github.com/mono/CppSharp/blob/main/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std-symbols.cpp. There are some other techniques we use for forcing constructors to get exported for instance. There is a flag to do it at the compiler level but Clang (and maybe GCC) for instance just ignores it and does nothing with it, so nothing reliable we can use.
Dunno, I guess it's fine to add a new helper. Just wondering about the name, should it be The only other thing that comes to mind is maybe use it recursively: public static bool IsTemplateParameterType(this Type type)
{
if (type is TemplateParameterType or TemplateParameterSubstitutionType)
return true;
var ptr = type;
while (ptr is PointerType pType)
{
ptr = pType.Pointee;
if (ptr.IsTemplateParameterType(ptr))
return true;
}
return false;
} |
You may be able to simplify it further with |
I don't think that is what I mean. If I try to do explicit template instantiation ( Either way, if this turns out to be a bug/missing feature I think it's preferable to just open an issue and deal with it later, the method should be fine for now.
Yep! I wasn't happy with the name either, this fits much better.
Very helpful! The code is much cleaner now! |
...Extensions
classes are no longer generatedstring
as a template argument is correctly castMarshalCharAsManagedChar
option also generates correct castsConsiderations:
IsTemplate
extension method is entirely correct or if the same functionality might exist someplace else.