Original Post
This should probably be in for beginners however since its not game related I thought it better to post here. I currently have an interface hierarchy that looks something like the following: root > i_plugina .....> i_pluginb > i_pluginba .................> i_pluginbb My registry module loads plugins (dll files) and gets a pointer to a low level interface (so i_pluginxx) which is cast up to a root pointer and stored. I want to pass these pointers to other plugins who then cast the pointer to the appropriate type for usage. so dll provides i_pluginba registry stores this as root plugin x requests i_pluginba by name and receives a root pointer plugin x casts root pointer to i_pluginba, uses the plugin However I am not sure what casts to use, the compiler suggests reinterpret_cast(root pointer) however dynamic_cast(root pointer) also compiles correctly. I have heard that casting down the hierarchy can be very dangerous however I cannot provide low level interfaces for all of the plugins, the registry is only aware of a few top level ones and the root type. So the real question is which cast do I use and will this be safe if I know the type of pointer it was originally cast from? Thanks