[ACCEPTED]-dyn_cast vs. dynamic_cast in C++-dynamic-cast

Accepted answer
Score: 16

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.

Score: 5

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.

More Related questions