G
Guest
Hello,
I'd like to know, whether it is possible to have type information associated with "null". I am implementing a wrapper (MC++) for our legacy method that accepts variable number of arguments and I need to distinguish types of passed parameters, which can have "null" values:
int Wrapper::Call(String *method, [ParamArray] System::Object *args[])
{
// ...
// args can be null
for(int i = 0, nCount = args->Count; i < nCount; i++)
{
if(__typeof(...)->Equals(args->GetType()))
// Do something for the first type
else
if(__typeof(...)->Equals(args->GetType()))
// Do something else for the second type
...
}
}
It would be nice to allow calls like this (e.g. from C#):
wrapper.Call("Method", 10, (TypeA)null, objB, (TypeC)null, 7);
I'd like to know, whether it is possible to have type information associated with "null". I am implementing a wrapper (MC++) for our legacy method that accepts variable number of arguments and I need to distinguish types of passed parameters, which can have "null" values:
int Wrapper::Call(String *method, [ParamArray] System::Object *args[])
{
// ...
// args can be null
for(int i = 0, nCount = args->Count; i < nCount; i++)
{
if(__typeof(...)->Equals(args->GetType()))
// Do something for the first type
else
if(__typeof(...)->Equals(args->GetType()))
// Do something else for the second type
...
}
}
It would be nice to allow calls like this (e.g. from C#):
wrapper.Call("Method", 10, (TypeA)null, objB, (TypeC)null, 7);