I'm writing a C++/CLI library which is supposed to be used by C# (managed) applications.
I want to write a method which accepts optional parameters, which in C# would be written as:
void Function (object obj, object opt1 = null, int opt2 = 0)
When writing such a thing in C# indeed shows the same thing in the Intellisense.
In C++/CLI I write in the header file:
void Function (Object^ obj, [Optional] Object^ opt1 , [Optional] int opt2);
After compiling my library I get in the C# Intellisense the following function:
void Function (object object, object opt1 = bad value, int opt2 = bad value)
Remark: I understand that the default value can not be changed to anything other than "default(TYPE)
", so I don't even try.