I used to ask if using as in C # is safe (that is, it won't explode): Is using a "how" in C # a safe casting method?
I liked the answer and in the end I used something based on it:
Foo x = y as Foo; if (x != null) { ... }
But now I am converting my C # code to C ++ / CLI (due to dependency problem ..), so questions ...
I am looking for a C ++ / CLI equivalent for "how" that is safe and will not explode at run time if not the correct type. Can someone suggest a cast that suits my needs? (please provide an example if you can)
Thanks!
developer
source share