I\'ve read somewhere on MSDN that the equivalent to C#\'s \"is\" keyword would be dynamic_cast, but that\'s not really equivalent: It doesn\'t work with value types or with
It's on MSDN:
How to: Implement is and as C# Keywords in C++
In a nutshell, you need to write a helper function like so:
template < class T, class U >
Boolean isinst(U u) {
return dynamic_cast< T >(u) != nullptr;
}
and call it like this:
Object ^ o = "f";
if ( isinst< String ^ >(o) )
Console::WriteLine("o is a string");