In C# I can write:
if(someObj is someType)
{ .. }
In C++/CLI I used:
if(someObj->GetType()->Eqals(someType::typeid))
{ .. }
Is there some other way to do this stuff in C++/CLI? Perhaps something more
elegant, like C# "is" keyword?
William DePalo [MVP VC++] - 07 Sep 2005 20:29 GMT
> In C# I can write:
> if(someObj is someType)
[quoted text clipped - 7 lines]
> more
> elegant, like C# "is" keyword?
Yes you can. Take a look at section 5.3 of this link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/Tra
nsGuide.asp
which discusses typeid.
Regards,
Will
William DePalo [MVP VC++] - 07 Sep 2005 22:29 GMT
>> In C# I can write:
>> if(someObj is someType)
[quoted text clipped - 13 lines]
>
> which discusses typeid.
Oops. Sorry. I see now that I offered you nothing new. :-(
Regards,
Will
vetplakh - 07 Sep 2005 23:38 GMT
Check out
http://msdn2.microsoft.com/library/85af44e9(en-us,vs.80).aspx
> In C# I can write:
> if(someObj is someType)
[quoted text clipped - 6 lines]
> Is there some other way to do this stuff in C++/CLI? Perhaps something more
> elegant, like C# "is" keyword?