[ACCEPTED]-dyn_cast vs. dynamic_cast in C++-dynamic-cast
Accepted answer
dyn_cast
is part of the LLVM API (and also is the 5 first, second, third, etc.. hit on google) works 4 just like dynamic_cast, however, one difference 3 is that the class doesn't require a v-table 2 like dynamic_cast. Please see the manual for more 1 info.
Actually, it is llvm::dyn_cast_or_null
which is equivalent to 2 dynamic_cast
.
These will produce a null pointer if passed 1 a null pointer, whereas llvm::dyn_cast
will bail.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.